package com.ship.dispatch.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.resource.InputStreamResource;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.ship.common.core.base.Page;
import com.ship.common.core.domain.R;
import com.ship.common.core.exception.BusException;
import com.ship.common.core.utils.DateUtil;
import com.ship.common.core.utils.bean.BeanUtils;
import com.ship.common.core.utils.file.FileUtils;
import com.ship.common.core.utils.uuid.UUID;
import com.ship.common.core.web.domain.BaseResultCode;
import com.ship.common.core.web.domain.JsonResult;
import com.ship.common.business.service.impl.BaseServiceImpl;
import com.ship.common.security.utils.SecurityUtils;
import com.ship.dispatch.bean.*;
import com.ship.dispatch.bean.boats.QueryBoatsBaseRq;
import com.ship.dispatch.bean.boats.info.QueryBoatsPortSisterInfo;
import com.ship.dispatch.bean.boats.info.QueryShipMessageInfo;
import com.ship.dispatch.bean.performance.PerformanceList;
import com.ship.dispatch.bean.treaShipNetwork.*;
import com.ship.dispatch.bo.*;
import com.ship.dispatch.enums.LoadPortStatus;
import com.ship.dispatch.mapper.*;
import com.ship.dispatch.model.ShipQueryModel;
import com.ship.dispatch.service.*;
import com.ship.dispatch.util.IDUtil;
import com.ship.dispatch.util.NumberFormatUtil;
import com.ship.dispatch.util.constant.ShipConstants;
import com.ship.dispatch.vo.PortVo;
import com.ship.dispatch.vo.SpOverhaulVo;
import com.ship.dispatch.vo.shipReport.ShipReportDetailDataVO;
import com.ship.system.api.RemoteFileService;
import com.ship.system.api.domain.SysFile;
import com.ship.system.api.domain.dispatch.SimpleShipInfoVo;
import org.apache.catalina.security.SecurityUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service;
import io.swagger.annotations.ApiModelProperty;
import org.apache.poi.ss.usermodel.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.*;

import java.lang.reflect.Field;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

import java.beans.IntrospectionException;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;

/**
 * <p>
 * 船舶信息 服务实现类
 * </p>
 *
 * @author AbyssRabbit@163.com
 * @since 2023-10-18
 */
@Service
public class SpInformationServiceImpl extends BaseServiceImpl<SpInformationMapper, SpInformation> implements SpInformationService {

    @Autowired(required = false)
    private SpInformationMapper spInformationMapper;

    @Autowired(required = false)
    private SpInfoDetailsMapper spInfoDetailsMapper;

    @Autowired(required = false)
    private SpInformationListMapper spInformationListMapper;

    @Autowired(required = false)
    private SpPortInformationMapper portInformationMapper;

    @Autowired(required = false)
    private ConResourceMemorandumMapper memorandumMapper;

    @Autowired(required = false)
    private ConShippingMapper conShippingMapper;

    @Resource
    private RemoteFileService remoteFileService;

    @Autowired
    private ShipBaseExtendService shipBaseExtendService;

    @Autowired
    private ExportService exportService;

    @Override
    public List<SpInformation> getShips(ShipQueryModel shipQueryModel) {
        QueryWrapper<SpInformation> queryWrapper = new QueryWrapper<>();
        if (shipQueryModel.getOilConsumption() != null) {
            queryWrapper.eq("oil_consumption", shipQueryModel.getOilConsumption());
        }
        if (shipQueryModel.getFlagStates() != null && shipQueryModel.getFlagStates().size() != 0) {
            queryWrapper.in("country", shipQueryModel.getFlagStates());
        }
        if (shipQueryModel.getShipModelStart() != null) {
            queryWrapper.ge("ship_type", shipQueryModel.getShipModelStart());
        }
        if (shipQueryModel.getShipModelEnd() != null) {
            queryWrapper.le("ship_type", shipQueryModel.getShipModelEnd());
        }
        queryWrapper.notLike("imo", "virtualShip");
        List<SpInformation> spInformations = spInformationMapper.selectList(queryWrapper);
//        List<SpInformation> spInformationsUse = new ArrayList<>();
//        if (spInformations != null && spInformations.size() > 0) {
//            spInformations.stream().forEach(p -> {
//                QueryWrapper<ConShipping> conShipWrapper = new QueryWrapper<>();
//                conShipWrapper.in("status", 1, 2, 3);
//                conShipWrapper.lt("starting_date_of_lease_begin", new Date());
//                conShipWrapper.gt("redelivery_date_end", new Date());
//                conShipWrapper.eq("imo", p.getImo());
//                List<ConShipping> conShippings = conShippingMapper.selectList(conShipWrapper);
//                if (conShippings != null) {
//                    //判断港口的接卸能力 是否满足船只
//                    ConResourceMemorandum resourceMemorandum = memorandumMapper.selectById(shipQueryModel.getConId());
//                    if (resourceMemorandum != null) {
//                        BigDecimal capacity = resourceMemorandum.getLoadingOrUnloadingCapacity();
//                        BigDecimal mut = new BigDecimal(0);
//                        if(null != p.getStorageCapacity()){
//                            mut = p.getStorageCapacity().multiply(BigDecimal.valueOf(0.985))
//                                    .subtract(BigDecimal.valueOf(500)).multiply(BigDecimal.valueOf(22.5))
//                                    .setScale(0, BigDecimal.ROUND_DOWN);
//                        }
//                        if (capacity.compareTo(mut) > 0) {
//                            spInformationsUse.add(p);
//                        }
//                    }
//                }
//            });
//        }
//        return spInformationsUse;
        return spInformations;
    }

    @Override
    public List<String> getFlagStates() {
        List<SpInformation> spInformation = spInformationMapper.selectList(new QueryWrapper<>());
        spInformation = spInformation.stream().filter(s -> !s.getImo().equals(ShipConstants.VIRTUAL_SHIP)).collect(Collectors.toList());
        return spInformation.stream().map(SpInformation::getCountry).distinct().collect(Collectors.toList());
    }

    @Override
    public List<PortVo> getPort() {
        List<SpPortInformation> ports = portInformationMapper.selectList(new QueryWrapper<>());
        List<PortVo> res = new ArrayList<>();
        if(ports.size() == 0){
            return res;
        }
        Map<String,List<SpPortInformation>> portMap = ports.stream().collect(Collectors.groupingBy(SpPortInformation::getPortCountry));
        for (String s : portMap.keySet()) {
            List<SpPortInformation> portList = portMap.get(s);
            PortVo col = new PortVo();
            col.setCountry(s);
            col.setUnloadingPorts(portList);
            col.setLoadingPorts(portList);
            res.add(col);
        }
        return res;
    }

    @Override
    public List<PortTreeSelect> getPortTree(){
        List<SpPortInformation> ports = portInformationMapper.selectList(new QueryWrapper<>());
        List<PortTreeSelect> countyTreeList = new LinkedList<>();
        if(ports.size() == 0){
            return countyTreeList;
        }
        Map<String,List<SpPortInformation>> portMap = ports.stream().collect(Collectors.groupingBy(SpPortInformation::getPortCountry));
        for (String s : portMap.keySet()) {
            List<SpPortInformation> allPortList = portMap.get(s);
            List<SpPortInformation> portList = allPortList.stream()
                    .filter(entity -> entity.getPortType().intValue() == 1)
                    .collect(Collectors.toList());
            List<SpPortInformation> receiveList = allPortList.stream()
                    .filter(entity -> entity.getPortType().intValue() == 2)
                    .collect(Collectors.toList());
            Map<String,List<SpPortInformation>> receiveMap = new HashMap<>();
            if(receiveList.size() > 0){
                receiveMap = receiveList.stream().collect(Collectors.groupingBy(SpPortInformation::getParentPortName));
            }
            //封装国家级
            PortTreeSelect countyTree = new PortTreeSelect();
            countyTree.setLabel(s);
            countyTree.setPortType("0");
            //封装港口级
            List<PortTreeSelect> portTreeList = new LinkedList<>();
            for (SpPortInformation spPortInformation : portList) {
                String portName = spPortInformation.getPortNameEnglish();
                PortTreeSelect portTree = new PortTreeSelect();
                portTree.setLabel(portName);
                portTree.setPortType("1");
                portTree.setValue(String.valueOf(spPortInformation.getId()));
                //封装接收站级
                List<PortTreeSelect> receiveTreeList = new LinkedList<>();
                if(receiveMap.get(portName) != null){
                    for (SpPortInformation portInformation : receiveMap.get(portName)) {
                        PortTreeSelect receiveTree = new PortTreeSelect();
                        receiveTree.setLabel(portInformation.getPortNameEnglish());
                        receiveTree.setPortType("2");
                        receiveTree.setValue(String.valueOf(portInformation.getId()));
                        receiveTreeList.add(receiveTree);
                    }
                    receiveMap.remove(portName);
                }
                portTree.setChildren(receiveTreeList);
                portTreeList.add(portTree);
            }

            //没有找到所属港口的直接归属到对应国家下面
            for (String s1 : receiveMap.keySet()) {
                List<SpPortInformation> receiveOtherList = receiveMap.get(s1);
                for (SpPortInformation spPortInformation : receiveOtherList) {
                    PortTreeSelect portTree = new PortTreeSelect();
                    portTree.setLabel(spPortInformation.getPortNameEnglish());
                    portTree.setPortType("2");
                    portTree.setValue(String.valueOf(spPortInformation.getId()));
                    portTreeList.add(portTree);
                }
            }
            countyTree.setChildren(portTreeList);
            countyTreeList.add(countyTree);
        }
        return countyTreeList;
    }

    @Override
    public String queryMmsiByShipName(String shipName, String imo) {
        return baseMapper.queryMmsiByShipName(shipName,imo);
    }

    @Override
    public List<QueryShipMessageInfo> queryShipMessage(String queryType, String queryValue) {
        String shipName = null;
        String imo =null;
        if (StringUtils.isNotEmpty(queryType) && "1".equals(queryType)){
            shipName = queryValue;
        }else if (StringUtils.isNotEmpty(queryType) && "2".equals(queryType)){
            imo = queryValue;
        }
        return baseMapper.queryShipMessage(shipName,imo);
    }

    @Override
    public SpInformation queryShipImoByShipName(String vesselName) {
        return baseMapper.queryShipImoByShipName(vesselName);
    }

    @Override
    public boolean createShipBaseExtend(Map<String, List<IshShipBaseExtend>> map) {
        if (CollectionUtil.isNotEmpty(map)){
            if (CollectionUtil.isNotEmpty(map.get("operationShipList"))){
                List<IshShipBaseExtend> operationShipList = map.get("operationShipList");
                spInformationListMapper.updateStatusAll();
                operationShipList.forEach(item -> {
                    //根据船舶名称及imo查询船舶信息
                    IhsShipBase info = spInformationListMapper.queryShipByShipName(item.getImo());
                    if (null != info){
                        spInformationListMapper.updateStatusByImo(item.getImo());
                    }
                });
            }
        }

        boolean shipBaseExtend = shipBaseExtendService.createShipBaseExtend(map);
        return shipBaseExtend;
    }

    @Override
    public IshShipBaseExtend queryShipMessageInteriorByImo(String imo) {
        IshShipBaseExtend info = shipBaseExtendService.queryShipMessageInteriorByImo(imo);
        return info;
    }

    @Override
    public PageInfo<IshShipBaseExtend> queryUnderConstructionPage(Integer pageNum, Integer pageSize) {
        return shipBaseExtendService.queryUnderConstructionPage(pageNum,pageSize);
    }

    @Override
    public boolean deleteFromBById(List<String> ids) {
        if (CollectionUtil.isNotEmpty(ids)){
            ids.forEach(item -> {
                boolean status = spInformationMapper.deleteFromBById(Long.parseLong(item));
            });
        }
        return true;
    }

    public JsonResult virtualUpdate(VirtualShipAddBo bo) {
        SpInformation information = this.baseMapper.selectOne(
                new LambdaQueryWrapper<SpInformation>()
                        .eq(SpInformation::getNameOfVessel,bo.getShipName())
                        .last("limit 1")
        );
        if(information == null){
            return JsonResult.failed("虚拟船信息异常！");
        }
        if(information.getIsVirtual() == null || information.getIsVirtual().intValue() != 1){
            return JsonResult.failed("非虚拟船不能编辑！");
        }
        //组装租期、租金信息
        JSONArray array = new JSONArray();
        JSONObject json = new JSONObject();
        json.put("rentDateBegin", DateUtil.date2Str(bo.getRentDateBegin(),"yyyy-MM-dd HH:mm"));
        json.put("rentDateEnd",DateUtil.date2Str(bo.getRentDateEnd(),"yyyy-MM-dd HH:mm"));
        json.put("rentParagraph",bo.getRentParagraph());

        String unitStr = "";
        if (bo.getRentUnit().intValue() == 1) {
            unitStr = "$";
        }else if (bo.getRentUnit().intValue() == 2) {
            unitStr = "¥";
        }else if (bo.getRentUnit().intValue() == 3) {
            unitStr = "€";
        }
        json.put("rentParagraphStr", unitStr+NumberFormatUtil.numericFormatting(bo.getRentParagraph()));
        json.put("rentUnit",bo.getRentUnit());
        array.add(json);

        JSONArray rentArray = new JSONArray();
        JSONObject rentJson = new JSONObject();
        rentJson.put("虚拟租入",array);
        rentArray.add(rentJson);
        information.setRentTimeSlot(rentArray.toJSONString());
        information.setStorageCapacity(bo.getStorageCapacity());
        this.baseMapper.updateById(information);
        return JsonResult.success();
    }

    @Override
    public JsonResult virtualRent(ShipRentUpdateBo bo) {
        SpInformation information = this.baseMapper.selectOne(
                new LambdaQueryWrapper<SpInformation>()
                        .eq(SpInformation::getImo,bo.getImo())
                        .last("limit 1")
        );
        if(information == null){
            return JsonResult.failed("船只信息异常！");
        }
        List<ShipRentUpdateDetailBo> detailBoList = bo.getRentTimeSlot();
        JSONArray rentTimeSlot = new JSONArray();
        for (ShipRentUpdateDetailBo shipRentUpdateDetailBo : detailBoList) {
            List<VirtualShipRentDetailBo> detailList = shipRentUpdateDetailBo.getList();
            if(detailList.size() == 0){
                continue;
            }
            JSONArray rentArray = new JSONArray();
            for (VirtualShipRentDetailBo virtualShipRentDetailBo : detailList) {
                JSONObject json = new JSONObject();
                json.put("rentDateBegin", DateUtil.date2Str(virtualShipRentDetailBo.getRentDateBegin(),"yyyy-MM-dd HH:mm"));
                json.put("rentDateEnd",DateUtil.date2Str(virtualShipRentDetailBo.getRentDateEnd(),"yyyy-MM-dd HH:mm"));
                json.put("rentParagraph",virtualShipRentDetailBo.getRentParagraph());

                String unitStr = "";
                if (virtualShipRentDetailBo.getRentUnit().intValue() == 1) {
                    unitStr = "$";
                }else if (virtualShipRentDetailBo.getRentUnit().intValue() == 2) {
                    unitStr = "¥";
                }else if (virtualShipRentDetailBo.getRentUnit().intValue() == 3) {
                    unitStr = "€";
                }
                json.put("rentParagraphStr", unitStr+NumberFormatUtil.numericFormatting(virtualShipRentDetailBo.getRentParagraph()));
                json.put("rentUnit",virtualShipRentDetailBo.getRentUnit());
                rentArray.add(json);
            }
            JSONObject topJson = new JSONObject();
            topJson.put(shipRentUpdateDetailBo.getContractType(),rentArray);
            rentTimeSlot.add(topJson);
        }
        information.setRentTimeSlot(rentTimeSlot.toJSONString());
        this.baseMapper.updateById(information);
        return JsonResult.success();
    }

    @Override
    public IhsShipBaseList queryShipBaseByShipName(String shipName, String imo) {

        return baseMapper.queryShipBaseByShipName(shipName,imo);
    }

    @Override
    public List<SimpleShipInfoVo> getAllSimpleShipList() {
        List<SimpleShipInfoVo> resultList = spInformationListMapper.getAllSimpleShipList();
        return resultList;
    }

    @Override
    public JsonResult virtualAdd(VirtualShipAddBo bo) {
        this.virtualShipAdd(bo);
        return JsonResult.success();
    }

    @Override
    public List<ConResourceMemorandum> getCon() {
        QueryWrapper<ConResourceMemorandum> queryWrapper = new QueryWrapper<>();
        queryWrapper.in("trade_type", Arrays.asList(1, 2));
        return memorandumMapper.selectList(queryWrapper);
    }

    /**
     * 船运合同中拉取所有满足条件的船舶
     *
     * @return
     */
    @Override
    public List<SpInformation> getAllSpInformationUsed(Integer year) {
        List<SpInformation> informations = new ArrayList<>();
        QueryWrapper<ConShipping> conShipWrapper = new QueryWrapper<>();
        conShipWrapper.in("status", 1, 2, 3);
        if(year != null){
            String start = (year+"-01-01 00:00:00");
            String end = (year+"-12-31 23:59:59");
            conShipWrapper.lt("starting_date_of_lease_begin", end);
            conShipWrapper.gt("redelivery_date_end", start);
        }
        List<ConShipping> conShippings = conShippingMapper.selectList(conShipWrapper);
        if(conShippings.size() == 0){
            return informations;
        }
        Map<String,List<ConShipping>> dataMap = conShippings.stream().collect(Collectors.groupingBy(ConShipping::getImo));
        for (String imo : dataMap.keySet()) {
            List<ConShipping> dataList = dataMap.get(imo);
            LambdaQueryWrapper<SpInformation> queryWrapper = new LambdaQueryWrapper<>();
            queryWrapper.eq(SpInformation::getImo, imo);
            queryWrapper.last("limit 1");

            SpInformation information = spInformationMapper.selectOne(queryWrapper);
            if (information == null) {
                continue;
            }
            if(information.getStorageCapacity() != null){
                //仓容进行单位转换
                BigDecimal goodsQuantityNew = information.getStorageCapacity().multiply(BigDecimal.valueOf(0.985))
                        .subtract(BigDecimal.valueOf(500)).multiply(BigDecimal.valueOf(22.5))
                        .setScale(0, BigDecimal.ROUND_DOWN);
                information.setStorageCapacityMmbtu(goodsQuantityNew);
            }
            dataList.sort(Comparator.comparingInt(ConShipping::getContractType));
            Map<Integer,List<ConShipping>> dataMapType = dataList.stream().collect(Collectors.groupingBy(ConShipping::getContractType));
            JSONArray rentTimeSlot = new JSONArray();
            for (Integer integer : dataMapType.keySet()) {
                JSONArray rentArray = new JSONArray();
                List<ConShipping> typeDataList = dataMapType.get(integer);
                for (ConShipping conShipping : typeDataList) {
                    if(StringUtils.isBlank(conShipping.getRentTimeSlot())){
                        JSONObject json = new JSONObject();
                        json.put("rentDateBegin", DateUtil.date2Str(conShipping.getDeliveryDateBegin(),"yyyy-MM-dd HH:mm"));
                        json.put("rentDateEnd",DateUtil.date2Str(conShipping.getRedeliveryDateEnd(),"yyyy-MM-dd HH:mm"));
                        json.put("rentParagraph",conShipping.getRent());

                        String unitStr = "";
                        if (conShipping.getCurrency().intValue() == 1) {
                            unitStr = "$";
                        }else if (conShipping.getCurrency().intValue() == 2) {
                            unitStr = "¥";
                        }else if (conShipping.getCurrency().intValue() == 3) {
                            unitStr = "€";
                        }
                        json.put("rentParagraphStr", unitStr+NumberFormatUtil.numericFormatting(conShipping.getRent()));
                        json.put("rentUnit",conShipping.getCurrency());
                        rentArray.add(json);
                    }else{
                        JSONArray detailArray = JSONArray.parseArray(conShipping.getRentTimeSlot());
                        for (Object o : detailArray) {
                            rentArray.add(o);
                        }
                    }
                }
                if(rentArray.size() > 0){
                    String typeName = "租入长期船";
                    if(integer.intValue() == 2){
                        typeName = "租入短期船";
                    }else if(integer.intValue() == 3){
                        typeName = "船舶租出";
                    }else if(integer.intValue() == 4){
                        typeName = "内部转租";
                    }
                    JSONObject json = new JSONObject();
                    json.put(typeName,rentArray);
                    rentTimeSlot.add(json);
                }
            }


            information.setRentTimeSlot(rentTimeSlot.toJSONString());
            information.setEvaporationRate(dataList.get(0).getEvaporationRate());
            information.setRedeliveryStatus(dataList.get(0).getRedeliveryStatus());
            informations.add(information);
        }
        informations = informations.stream().sorted(Comparator.comparing(SpInformation::getNameOfVessel)).collect(Collectors.toList());

        LambdaQueryWrapper<SpInformation> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SpInformation::getIsVirtual, 1);
        queryWrapper.eq(SpInformation::getCreateBy, SecurityUtils.getUsername());
//        queryWrapper.ge(SpInformation::getLeaseTime, new Date());
        List<SpInformation> virtualShips = spInformationMapper.selectList(queryWrapper);
        for (SpInformation virtualShip : virtualShips) {
            if(StringUtils.isBlank(virtualShip.getRentTimeSlot())){
                continue;
            }
            if(virtualShip.getStorageCapacity() != null){
                //仓容进行单位转换
                BigDecimal goodsQuantityNew = virtualShip.getStorageCapacity().multiply(BigDecimal.valueOf(0.985))
                        .subtract(BigDecimal.valueOf(500)).multiply(BigDecimal.valueOf(22.5))
                        .setScale(0, BigDecimal.ROUND_DOWN);
                virtualShip.setStorageCapacityMmbtu(goodsQuantityNew);
            }
            informations.add(virtualShip);
        }
        return informations;
    }

    /**
     * 船运合同中拉取所有满足条件的船舶
     *
     * @return
     */
    @Override
    public List<SpInformation> getAllSpInformationUsedPotential() {
        List<SpInformation> informations = new ArrayList<>();
        QueryWrapper<ConShipping> conShipWrapper = new QueryWrapper<>();
        conShipWrapper.in("status", 1, 2, 3);
        List<ConShipping> conShippings = conShippingMapper.selectList(conShipWrapper);
        if(conShippings.size() == 0){
            return informations;
        }
        Map<String,List<ConShipping>> dataMap = conShippings.stream().collect(Collectors.groupingBy(ConShipping::getImo));
        for (String imo : dataMap.keySet()) {
            List<ConShipping> dataList = dataMap.get(imo);
            LambdaQueryWrapper<SpInformation> queryWrapper = new LambdaQueryWrapper<>();
            queryWrapper.eq(SpInformation::getImo, imo);
            queryWrapper.last("limit 1");
            SpInformation information = spInformationMapper.selectOne(queryWrapper);
            if (information == null) {
                continue;
            }
            if(information.getStorageCapacity() != null){
                //仓容进行单位转换
                BigDecimal goodsQuantityNew = information.getStorageCapacity().multiply(BigDecimal.valueOf(0.985))
                        .subtract(BigDecimal.valueOf(500)).multiply(BigDecimal.valueOf(22.5))
                        .setScale(0, BigDecimal.ROUND_DOWN);
                information.setStorageCapacityMmbtu(goodsQuantityNew);
            }
            if(StringUtils.isBlank(information.getRentTimeSlot())){
                dataList.sort(Comparator.comparingInt(ConShipping::getContractType));
                Map<Integer,List<ConShipping>> dataMapType = dataList.stream().collect(Collectors.groupingBy(ConShipping::getContractType));
                JSONArray rentTimeSlot = new JSONArray();
                for (Integer integer : dataMapType.keySet()) {
                    JSONArray rentArray = new JSONArray();
                    List<ConShipping> typeDataList = dataMapType.get(integer);
                    for (ConShipping conShipping : typeDataList) {
                        if(StringUtils.isBlank(conShipping.getRentTimeSlot())){
                            JSONObject json = new JSONObject();
                            json.put("rentDateBegin", DateUtil.date2Str(conShipping.getDeliveryDateBegin(),"yyyy-MM-dd HH:mm"));
                            json.put("rentDateEnd",DateUtil.date2Str(conShipping.getRedeliveryDateEnd(),"yyyy-MM-dd HH:mm"));
                            json.put("rentParagraph",conShipping.getRent());

                            String unitStr = "";
                            if (conShipping.getCurrency().intValue() == 1) {
                                unitStr = "$";
                            }else if (conShipping.getCurrency().intValue() == 2) {
                                unitStr = "¥";
                            }else if (conShipping.getCurrency().intValue() == 3) {
                                unitStr = "€";
                            }
                            json.put("rentParagraphStr", unitStr+NumberFormatUtil.numericFormatting(conShipping.getRent()));
                            json.put("rentUnit",conShipping.getCurrency());
                            rentArray.add(json);
                        }else{
                            JSONArray detailArray = JSONArray.parseArray(conShipping.getRentTimeSlot());
                            for (Object o : detailArray) {
                                rentArray.add(o);
                            }
                        }
                    }
                    if(rentArray.size() > 0){
                        String typeName = "租入长期船";
                        if(integer.intValue() == 2){
                            typeName = "租入短期船";
                        }else if(integer.intValue() == 3){
                            typeName = "船舶租出";
                        }else if(integer.intValue() == 4){
                            typeName = "内部转租";
                        }
                        JSONObject json = new JSONObject();
                        json.put(typeName,rentArray);
                        rentTimeSlot.add(json);
                    }
                }
                information.setRentTimeSlot(rentTimeSlot.toJSONString());
            }
            information.setEvaporationRate(dataList.get(0).getEvaporationRate());
            information.setRedeliveryStatus(dataList.get(0).getRedeliveryStatus());
            informations.add(information);
        }
        informations = informations.stream().sorted(Comparator.comparing(SpInformation::getNameOfVessel)).collect(Collectors.toList());

        LambdaQueryWrapper<SpInformation> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SpInformation::getIsVirtual, 1);
        queryWrapper.eq(SpInformation::getCreateBy, SecurityUtils.getUsername());
//        queryWrapper.ge(SpInformation::getLeaseTime, new Date());
        List<SpInformation> virtualShips = spInformationMapper.selectList(queryWrapper);
        for (SpInformation virtualShip : virtualShips) {
            if(virtualShip.getStorageCapacity() != null){
                //仓容进行单位转换
                BigDecimal goodsQuantityNew = virtualShip.getStorageCapacity().multiply(BigDecimal.valueOf(0.985))
                        .subtract(BigDecimal.valueOf(500)).multiply(BigDecimal.valueOf(22.5))
                        .setScale(0, BigDecimal.ROUND_DOWN);
                virtualShip.setStorageCapacityMmbtu(goodsQuantityNew);
            }
            if(StringUtils.isBlank(virtualShip.getRentTimeSlot())){
                continue;
            }
//            JSONArray rentTimeSlot = new JSONArray();
//            JSONObject json = new JSONObject();
//            json.put("虚拟合同",JSONArray.parseArray(virtualShip.getRentTimeSlot()));
//            rentTimeSlot.add(json);
//            virtualShip.setRentTimeSlot(rentTimeSlot.toJSONString());
            informations.add(virtualShip);
        }
        return informations;
    }

    /**
     * 获取可用船只信息
     * @param date 有效时间点
     * @return
     */
    @Override
    public Map<String,List<SpInformation>> getConSpInformation(Date date) {
        Map<String,List<SpInformation>> resultMap = new HashMap<>();

        List<SpInformation> normalShips = new LinkedList<>();
        LambdaQueryWrapper<ConShipping> conShipWrapper = new LambdaQueryWrapper<>();
        conShipWrapper.in(ConShipping::getStatus, 1, 2, 3);
        conShipWrapper.lt(ConShipping::getDeliveryDateBegin, date);
        conShipWrapper.gt(ConShipping::getRedeliveryDateEnd, date);
        List<ConShipping> conShippings = conShippingMapper.selectList(conShipWrapper);
        if(conShippings.size() == 0){
            resultMap.put("normalShips",normalShips);
            resultMap.put("virtualShips",new LinkedList<>());
            return resultMap;
        }
        Map<String,List<ConShipping>> dataMap = conShippings.stream().collect(Collectors.groupingBy(ConShipping::getImo));
        for (String imo : dataMap.keySet()) {
            List<ConShipping> dataList = dataMap.get(imo);
            LambdaQueryWrapper<SpInformation> queryWrapper = new LambdaQueryWrapper<>();
            queryWrapper.eq(SpInformation::getImo, imo);
            queryWrapper.last("limit 1");

            SpInformation information = spInformationMapper.selectOne(queryWrapper);
            if (information == null) {
                continue;
            }
            dataList.sort(Comparator.comparingInt(ConShipping::getContractType));
            Map<Integer,List<ConShipping>> dataMapType = dataList.stream().collect(Collectors.groupingBy(ConShipping::getContractType));
            JSONArray rentTimeSlot = new JSONArray();
            for (Integer integer : dataMapType.keySet()) {
                JSONArray rentArray = new JSONArray();
                List<ConShipping> typeDataList = dataMapType.get(integer);
                for (ConShipping conShipping : typeDataList) {
                    if(StringUtils.isBlank(conShipping.getRentTimeSlot())){
                        continue;
                    }
                    JSONArray detailArray = JSONArray.parseArray(conShipping.getRentTimeSlot());
                    for (Object o : detailArray) {
                        rentArray.add(o);
                    }
                }
                if(rentArray.size() > 0){
                    String typeName = "租入长期船";
                    if(integer.intValue() == 2){
                        typeName = "租入短期船";
                    }else if(integer.intValue() == 3){
                        typeName = "船舶租出";
                    }else if(integer.intValue() == 4){
                        typeName = "内部转租";
                    }
                    JSONObject json = new JSONObject();
                    json.put(typeName,rentArray);
                    rentTimeSlot.add(json);
                }
            }
            information.setRentTimeSlot(rentTimeSlot.toJSONString());
            information.setEvaporationRate(dataList.get(0).getEvaporationRate());
            information.setRedeliveryStatus(dataList.get(0).getRedeliveryStatus());

            normalShips.add(information);
        }
        resultMap.put("normalShips",normalShips);

        LambdaQueryWrapper<SpInformation> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SpInformation::getIsVirtual, 1);
        queryWrapper.eq(SpInformation::getCreateBy, SecurityUtils.getUsername());
//        queryWrapper.ge(SpInformation::getLeaseTime, date);
        List<SpInformation> virtualShips = spInformationMapper.selectList(queryWrapper);
        for (SpInformation virtualShip : virtualShips) {
            if(StringUtils.isBlank(virtualShip.getRentTimeSlot())){
                continue;
            }
        }
        resultMap.put("virtualShips",virtualShips);

        return resultMap;
    }

    /**
     * 添加虚拟船(调度优化)
     *
     * @param virtualShipBO
     */
    @Override
    public SpInformation saveOptimizeVirtualShip(VirtualShipOptimizeBO virtualShipBO) {
        //获取当前虚拟船数量
        Long count = this.baseMapper.selectCount(
                new LambdaQueryWrapper<SpInformation>()
                        .eq(SpInformation::getIsVirtual,1)
        );
        long shipNo = (count + 1);
        SpInformation spInformation = new SpInformation();
        spInformation.setId(IDUtil.nextId());
        spInformation.setImo(ShipConstants.VIRTUAL_SHIP+shipNo);
        spInformation.setNameOfVessel("虚拟船"+shipNo);
        spInformation.setCountry("1");
        spInformation.setOilConsumption(new BigDecimal("9000"));
        spInformation.setCreateBy("1");
        spInformation.setCreateDate(new Date());
        spInformation.setIsVirtual(1);
        spInformation.setLeaseTime(com.ship.common.core.utils.DateUtil.String2Date("2099-01-01 00:00:00","yyyy-MM-dd"));
        spInformation.setLeaseDuration(99999);
        //虚拟船默认大船
        spInformation.setStorageCapacity(virtualShipBO.getStorageCapacity());
        spInformationMapper.insert(spInformation);
        return spInformation;
    }

    /**
     * 虚拟船新增逻辑
     * @param bo
     */
    public SpInformation virtualShipAdd(VirtualShipAddBo bo){
        //获取当前虚拟船数量
        Long count = this.baseMapper.selectCount(
                new LambdaQueryWrapper<SpInformation>()
                        .eq(SpInformation::getIsVirtual,1)
        );
        long shipNo = (count + 1);
        SpInformation spInformation = new SpInformation();
        spInformation.setId(IDUtil.nextId());
        spInformation.setImo(ShipConstants.VIRTUAL_SHIP+shipNo);
        spInformation.setNameOfVessel("虚拟船"+shipNo);
        spInformation.setCountry("1");
        spInformation.setOilConsumption(new BigDecimal("9000"));
        spInformation.setCreateBy(SecurityUtils.getUsername());
        spInformation.setCreateDate(new Date());
        spInformation.setIsVirtual(1);
        spInformation.setStorageCapacity(bo.getStorageCapacity());

        if(bo.getRentDateBegin() != null){
            //组装租期、租金信息
            JSONArray array = new JSONArray();
            JSONObject json = new JSONObject();
            json.put("rentDateBegin", DateUtil.date2Str(bo.getRentDateBegin(),"yyyy-MM-dd HH:mm"));
            json.put("rentDateEnd",DateUtil.date2Str(bo.getRentDateEnd(),"yyyy-MM-dd HH:mm"));
            json.put("rentParagraph",bo.getRentParagraph());

            String unitStr = "";
            if (bo.getRentUnit().intValue() == 1) {
                unitStr = "$";
            }else if (bo.getRentUnit().intValue() == 2) {
                unitStr = "¥";
            }else if (bo.getRentUnit().intValue() == 3) {
                unitStr = "€";
            }
            json.put("rentParagraphStr", unitStr+NumberFormatUtil.numericFormatting(bo.getRentParagraph()));
            json.put("rentUnit",bo.getRentUnit());
            array.add(json);

            JSONArray rentArray = new JSONArray();
            JSONObject rentJson = new JSONObject();
            rentJson.put("虚拟租入",array);
            rentArray.add(rentJson);
            spInformation.setRentTimeSlot(rentArray.toJSONString());
        }
        int saveNum = spInformationMapper.insert(spInformation);
        return spInformation;
    }

    @Override
    public SpInformation createVirtualSpInformation() {
        VirtualShipAddBo bo = new VirtualShipAddBo();
        bo.setStorageCapacity(new BigDecimal("175000"));

        //自动新增虚拟船默认按当前年时间为租期
        Date currentDate = new Date();
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(currentDate);
        // 获取年份的第一天
        calendar.set(Calendar.MONTH, Calendar.JANUARY);
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        Date firstDayOfYear = calendar.getTime();
        // 获取年份的最后一天
        calendar.set(Calendar.MONTH, Calendar.DECEMBER);
        calendar.set(Calendar.DAY_OF_MONTH, 31);
        Date lastDayOfYear = calendar.getTime();
        bo.setRentDateBegin(firstDayOfYear);
        bo.setRentDateEnd(lastDayOfYear);
        bo.setRentParagraph(new BigDecimal("6000"));
        bo.setRentUnit(1);
        SpInformation spInformation = this.virtualShipAdd(bo);
        return spInformation;
    }

    @Override
    public JsonResult getListInfo(IhsShipBaseSelVo ihsShipBaseSelVo) {
//        Page<IhsShipBaseList> resultPage = new Page<>();;
//        if (!isEmptyList(ihsShipBaseSelVo.getImoList()) || !isEmptyList(ihsShipBaseSelVo.getShipNameList())
//                || !isEmptyList(ihsShipBaseSelVo.getShipStatusList()) || !isEmptyList(ihsShipBaseSelVo.getMainEngineTypeList())
//        ) {
//            // 如果 imo 或者 nameOfVessel 不为空，执行模糊查询
//            QueryWrapper<IhsShipBaseList> queryWrapper = new QueryWrapper<>();
//            if (!isEmptyList(ihsShipBaseSelVo.getImoList())) {
//                for (String imo : ihsShipBaseSelVo.getImoList()) {
//                    queryWrapper.or().like("imo", "%" + imo + "%");
//                }
//            }
//            if (!isEmptyList(ihsShipBaseSelVo.getShipNameList())) {
//                for (String shipName : ihsShipBaseSelVo.getShipNameList()) {
//                    queryWrapper.or().like("ship_name", "%" + shipName + "%");
//                }
//            }
//            if (!isEmptyList(ihsShipBaseSelVo.getShipStatusList())) {
//                for (String shipStatus : ihsShipBaseSelVo.getShipStatusList()) {
//                    queryWrapper.or().like("ship_status", "%" + shipStatus + "%");
//                }
//            }
//            if (!isEmptyList(ihsShipBaseSelVo.getMainEngineTypeList())) {
//                for (String mainEngineType : ihsShipBaseSelVo.getMainEngineTypeList()) {
//                    queryWrapper.or().like("main_engine_type", "%" + mainEngineType + "%");
//                }
//            }
////             执行查询
//            PageHelper.startPage(ihsShipBaseSelVo.getPageNum(), ihsShipBaseSelVo.getPageSize());
//            result = spInformationListMapper.selectList(queryWrapper);
//        } else {
////           如果 imo 和 nameOfVessel 均为空，查询全部结果
//            PageHelper.startPage(ihsShipBaseSelVo.getPageNum(), ihsShipBaseSelVo.getPageSize());
//            result = spInformationListMapper.getListInfo();
//        }
        PageHelper.startPage(ihsShipBaseSelVo.getPageNum(),ihsShipBaseSelVo.getPageSize());
        List<IhsShipBaseList> result = spInformationListMapper.queryShipList(ihsShipBaseSelVo);
        PageInfo<IhsShipBaseList> pageInfo = new PageInfo<>(result);
//        int totalItems = result.size();
//        int totalItems = spInformationListMapper.getSize();
//        resultPage.setList(result);
//        resultPage.setPageNum(ihsShipBaseSelVo.getPageNum());
//        resultPage.setPageSize(ihsShipBaseSelVo.getPageSize());
//        resultPage.setTotal(totalItems);
        return JsonResult.success(pageInfo);
    }

    @Override
    public Object getQueryCriteria() {
        List<String> stringList1 = spInformationListMapper.getShipNmae().stream().distinct().collect(Collectors.toList());
        List<String> stringList2 = spInformationListMapper.getImo().stream().distinct().collect(Collectors.toList());
        List<String> stringList3 = spInformationListMapper.getShipStatusList().stream().distinct().collect(Collectors.toList());
        List<String> stringList4 = spInformationListMapper.getMainEngineTypeList().stream().distinct().collect(Collectors.toList());
        Map<String,List<String>> result = new HashMap<>();
        result.put("shipNameList",stringList1);
        result.put("imoList",stringList2);
        result.put("shipStatusList",stringList3);
        result.put("mainEngineTypeList",stringList4);
        return result;
    }

    @Override
    public List<IhsShipBaseDetailVO> getShipInfoDetail(String imoId) throws IntrospectionException {
        List<IhsShipBaseDetailVO> shipReportDetailVOS = new ArrayList<>();
        IhsShipBase ihsShipBase = spInformationListMapper.getShipInfoByImo(imoId);

        if (null != ihsShipBase) {
            //基本信息 baseInformation
            IhsShipBaseDetailVO baseInformation = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> vesselInfoData = new ArrayList<>();
            baseInformation.setTitle("基本信息");
            baseInformation.setId("baseInformation");
            baseInformation.setFormatType(1);
            ShipReportDetailDataVO shipName  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO imo  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO mmsi  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO callsign  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO portOfRegistry  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO portOfRegistryCode  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO gasCapacity  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO shipStatus  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO shipStatusCode  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO shipStatusEffectiveDate  = new ShipReportDetailDataVO();
            shipName.setKey("船舶名称");
            imo.setKey("imo");
            mmsi.setKey("MMSI");
            callsign.setKey("呼号");
            portOfRegistry.setKey("船籍港");
            portOfRegistryCode.setKey("船籍港代码");
            gasCapacity.setKey("装气舱容");
            shipStatus.setKey("船舶状态");
            shipStatusCode.setKey("船舶状态代码");
            shipStatusEffectiveDate.setKey("船舶运营日期");
            if (ihsShipBase.getShipName() ==null){
                shipName.setValue("");
            }
            else {
                shipName.setValue(ihsShipBase.getShipName());
            }
            if (ihsShipBase.getImo() ==null){
                imo.setValue("");
            }
            else {
                imo.setValue(ihsShipBase.getImo());
            }
            if (ihsShipBase.getMmsi() ==null){
                mmsi.setValue("");
            }
            else {
                mmsi.setValue(ihsShipBase.getMmsi());
            }
            if (ihsShipBase.getCallsign() ==null){
                callsign.setValue("");
            }
            else {
                callsign.setValue(ihsShipBase.getCallsign());
            }
            if (ihsShipBase.getPortOfRegistry() ==null){
                portOfRegistry.setValue("");
            }
            else {
                portOfRegistry.setValue(ihsShipBase.getPortOfRegistry());
            }
            if (ihsShipBase.getPortOfRegistryCode() ==null){
                portOfRegistryCode.setValue("");
            }
            else {
                portOfRegistryCode.setValue(ihsShipBase.getPortOfRegistryCode());
            }
            if (ihsShipBase.getGasCapacity() ==null){
                gasCapacity.setValue("");
            }
            else {
                gasCapacity.setValue(ihsShipBase.getGasCapacity().toString());
            }
            if (ihsShipBase.getShipStatus() ==null){
                shipStatus.setValue("");
            }
            else {
                shipStatus.setValue(ihsShipBase.getShipStatus());
            }
            if (ihsShipBase.getShipStatusCode() ==null){
                shipStatusCode.setValue("");
            }
            else {
                shipStatusCode.setValue(ihsShipBase.getShipStatusCode());
            }
            if (ihsShipBase.getShipStatusEffectiveDate() ==null){
                shipStatusEffectiveDate.setValue("");
            }
            else {
                shipStatusEffectiveDate.setValue(ihsShipBase.getShipStatusEffectiveDate());
            }
            shipName.setType("input");
            imo.setType("input");
            mmsi.setType("input");
            callsign.setType("input");
            portOfRegistry.setType("input");
            portOfRegistryCode.setType("input");
            gasCapacity.setType("input");
            shipStatus.setType("input");
            shipStatusCode.setType("input");
            shipStatusEffectiveDate.setType("input");
            shipName.setDescribe("船舶名称");
            imo.setDescribe("imo");
            mmsi.setDescribe("MMSI");
            callsign.setDescribe("呼号");
            portOfRegistry.setDescribe("船籍港");
            portOfRegistryCode.setDescribe("船籍港代码");
            gasCapacity.setDescribe("装气舱容");
            shipStatus.setDescribe("船舶状态");
            shipStatusCode.setDescribe("船舶状态代码");
            shipStatusEffectiveDate.setDescribe("船舶运营日期");
            vesselInfoData.add(shipName);
            vesselInfoData.add(imo);
            vesselInfoData.add(mmsi);
            vesselInfoData.add(callsign);
            vesselInfoData.add(portOfRegistry);
            vesselInfoData.add(portOfRegistryCode);
            vesselInfoData.add(gasCapacity);
            vesselInfoData.add(shipStatus);
            vesselInfoData.add(shipStatusCode);
            vesselInfoData.add(shipStatusEffectiveDate);

            baseInformation.setData(vesselInfoData);
            shipReportDetailVOS.add(baseInformation);


            //建造信息 constructInfo
            IhsShipBaseDetailVO constructInfo = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> constructInfoData = new ArrayList<>();
            constructInfo.setTitle("建造信息");
            constructInfo.setId("constructInfo");
            constructInfo.setFormatType(1);

            ShipReportDetailDataVO shipBuilder  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO shipbuilderFullStyle  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO countryOfBuild  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO countryOfBuildCode  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO yearOfBuild  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO dateOfBuild  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO launchDate  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO newBuildPriceUsd  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO newConstructionEntryDate  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO contractDate  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO deliveryDate  = new ShipReportDetailDataVO();

            shipBuilder.setKey("造船厂");
            shipbuilderFullStyle.setKey("造船厂全称");
            countryOfBuild.setKey("建造国");
            countryOfBuildCode.setKey("建造国代码");
            yearOfBuild.setKey("建造年份");
            dateOfBuild.setKey("建造日期");
            launchDate.setKey("下水日期");
            newBuildPriceUsd.setKey("新造船价格");
            newConstructionEntryDate.setKey("建造激活日期");
            contractDate.setKey("造船订单合同日期");
            deliveryDate.setKey("交船日期");

            if (ihsShipBase.getShipBuilder() ==null){
                shipBuilder.setValue("");
            }
            else {
                shipBuilder.setValue(ihsShipBase.getShipBuilder());
            }
            if (ihsShipBase.getShipBuilderFullStyle() ==null){
                shipbuilderFullStyle.setValue("");
            }
            else {
                shipbuilderFullStyle.setValue(ihsShipBase.getShipBuilderFullStyle());
            }
            if (ihsShipBase.getCountryOfBuild() ==null){
                countryOfBuild.setValue("");
            }
            else {
                countryOfBuild.setValue(ihsShipBase.getCountryOfBuild());
            }
            if (ihsShipBase.getCountryOfBuildCode() ==null){
                countryOfBuildCode.setValue("");
            }
            else {
                countryOfBuildCode.setValue(ihsShipBase.getCountryOfBuildCode());
            }
            if (ihsShipBase.getYearOfBuild() ==null){
                yearOfBuild.setValue("");
            }
            else {
                yearOfBuild.setValue(ihsShipBase.getYearOfBuild().toString());
            }
            if (ihsShipBase.getDateOfBuild() ==null){
                dateOfBuild.setValue("");
            }
            else {
                dateOfBuild.setValue(ihsShipBase.getDateOfBuild());
            }
            if (ihsShipBase.getLaunchDate() ==null){
                launchDate.setValue("");
            }
            else {
                launchDate.setValue(ihsShipBase.getLaunchDate());
            }
            if (ihsShipBase.getNewBuildPriceUsd() ==null){
                newBuildPriceUsd.setValue("");
            }
            else {
                newBuildPriceUsd.setValue(ihsShipBase.getNewBuildPriceUsd().toString());
            }
            if (ihsShipBase.getNewConstructionEntryDate() ==null){
                newConstructionEntryDate.setValue("");
            }
            else {
                newConstructionEntryDate.setValue(ihsShipBase.getNewConstructionEntryDate());
            }
            if (ihsShipBase.getContractDate() ==null){
                contractDate.setValue("");
            }
            else {
                contractDate.setValue(ihsShipBase.getContractDate());
            }
            if (ihsShipBase.getDeliveryDate() ==null){
                deliveryDate.setValue("");
            }
            else {
                deliveryDate.setValue(ihsShipBase.getDeliveryDate());
            }

            shipBuilder.setType("input");
            shipbuilderFullStyle.setType("input");
            countryOfBuild.setType("input");
            countryOfBuildCode.setType("input");
            yearOfBuild.setType("input");
            dateOfBuild.setType("input");
            launchDate.setType("input");
            newBuildPriceUsd.setType("input");
            newConstructionEntryDate.setType("input");
            contractDate.setType("input");
            deliveryDate.setType("input");

            shipBuilder.setDescribe("造船厂");
            shipbuilderFullStyle.setDescribe("造船厂全称");
            countryOfBuild.setDescribe("建造国");
            countryOfBuildCode.setDescribe("建造国代码");
            yearOfBuild.setDescribe("建造年份");
            dateOfBuild.setDescribe("建造日期");
            launchDate.setDescribe("下水日期");
            newBuildPriceUsd.setDescribe("新造船价格");
            newConstructionEntryDate.setDescribe("建造激活日期");
            contractDate.setDescribe("造船订单合同日期");
            deliveryDate.setDescribe("交船日期");

            constructInfoData.add(shipBuilder);
            constructInfoData.add(shipbuilderFullStyle);
            constructInfoData.add(countryOfBuild);
            constructInfoData.add(countryOfBuildCode);
            constructInfoData.add(yearOfBuild);
            constructInfoData.add(dateOfBuild);
            constructInfoData.add(launchDate);
            constructInfoData.add(newBuildPriceUsd);
            constructInfoData.add(newConstructionEntryDate);
            constructInfoData.add(contractDate);
            constructInfoData.add(deliveryDate);

            constructInfo.setData(constructInfoData);
            shipReportDetailVOS.add(constructInfo);

            //船旗信息 flagInfo
            IhsShipBaseDetailVO flagInfo = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> flagInfoData = new ArrayList<>();
            flagInfo.setTitle("船旗信息");
            flagInfo.setId("flagInfo");
            flagInfo.setFormatType(1);

            ShipReportDetailDataVO flagName  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO flagCode  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO flagEffectiveDate  = new ShipReportDetailDataVO();

            flagName.setKey("船旗国");
            flagCode.setKey("船旗国三位码");
            flagEffectiveDate.setKey("船旗国生效日");

            if (ihsShipBase.getFlagName() ==null){
                flagName.setValue("");
            }
            else {
                flagName.setValue(ihsShipBase.getFlagName());
            }
            if (ihsShipBase.getFlagCode() ==null){
                flagCode.setValue("");
            }
            else {
                flagCode.setValue(ihsShipBase.getFlagCode());
            }
            if (ihsShipBase.getFlagEffectiveDate() ==null){
                flagEffectiveDate.setValue("");
            }
            else {
                flagEffectiveDate.setValue(ihsShipBase.getFlagEffectiveDate());
            }

            flagName.setType("input");
            flagCode.setType("input");
            flagEffectiveDate.setType("input");

            flagName.setDescribe("船旗国");
            flagCode.setDescribe("船旗国三位码");
            flagEffectiveDate.setDescribe("船旗国生效日");

            flagInfoData.add(flagName);
            flagInfoData.add(flagCode);
            flagInfoData.add(flagEffectiveDate);

            flagInfo.setData(flagInfoData);
            shipReportDetailVOS.add(flagInfo);

            //入级信息 ClassInfo
            IhsShipBaseDetailVO ClassInfo = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> ClassInfoData = new ArrayList<>();
            ClassInfo.setTitle("入级信息");
            ClassInfo.setId("ClassInfo");
            ClassInfo.setFormatType(1);

            ShipReportDetailDataVO classificationSociety  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO classificationSocietyCode  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO classNarrative  = new ShipReportDetailDataVO();

            classificationSociety.setKey("船级社");
            classificationSocietyCode.setKey("船级社代码");
            classNarrative.setKey("船级描述");

            if (ihsShipBase.getClassificationSociety() ==null){
                classificationSociety.setValue("");
            }
            else {
                classificationSociety.setValue(ihsShipBase.getClassificationSociety());
            }
            if (ihsShipBase.getClassificationSocietyCode() ==null){
                classificationSocietyCode.setValue("");
            }
            else {
                classificationSocietyCode.setValue(ihsShipBase.getClassificationSocietyCode());
            }
            if (ihsShipBase.getClassNarrative() ==null){
                classNarrative.setValue("");
            }
            else {
                classNarrative.setValue(ihsShipBase.getClassNarrative());
            }

            classificationSociety.setType("input");
            classificationSocietyCode.setType("input");
            classNarrative.setType("input");

            classificationSociety.setDescribe("船级社");
            classificationSocietyCode.setDescribe("船级社代码");
            classNarrative.setDescribe("船级描述");

            ClassInfoData.add(classificationSociety);
            ClassInfoData.add(classificationSocietyCode);
            ClassInfoData.add(classNarrative);

            ClassInfo.setData(ClassInfoData);
            shipReportDetailVOS.add(ClassInfo);

            //姊妹船 sisterShip
            IhsShipBaseDetailVO sisterShip = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> sisterShipData = new ArrayList<>();
            sisterShip.setTitle("姊妹船");
            sisterShip.setId("sisterShip");
            sisterShip.setFormatType(1);
            ShipReportDetailDataVO leadShipInseriesByImoNumber  = new ShipReportDetailDataVO();
            leadShipInseriesByImoNumber.setKey("IMO");
            if (ihsShipBase.getLengthOverallLoa() ==null){
                leadShipInseriesByImoNumber.setValue("");
            }
            else {
                leadShipInseriesByImoNumber.setValue(ihsShipBase.getLeadShipInseriesByImoNumber());
            }
            leadShipInseriesByImoNumber.setType("input");
            leadShipInseriesByImoNumber.setDescribe("IMO");
            sisterShipData.add(leadShipInseriesByImoNumber);
            sisterShip.setData(sisterShipData);
            shipReportDetailVOS.add(sisterShip);

            //主要参数 mainParameter
            IhsShipBaseDetailVO mainParameter = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> mainParameterData = new ArrayList<>();
            mainParameter.setTitle("主要参数");
            mainParameter.setId("mainParameter");
            mainParameter.setFormatType(1);

            ShipReportDetailDataVO lengthOverallLoa  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO lengthRegistered  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO breadthMoulded  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO breadthExtreme  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO depth  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO draught  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO lengthBetweenPerpendicularsLbp  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO keelToMastHeight  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO grossTonnage  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO compensatedGrossTonnageCgt  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO deadWeight  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO lightDisplacementTonnage  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO displacement  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO netTonnage  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO panamaCanalNetTonnagePcnt  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO suezCanalNetTonnageScnt  = new ShipReportDetailDataVO();

            lengthOverallLoa.setKey("总长");
            lengthRegistered.setKey("注册长度");
            breadthMoulded.setKey("型宽");
            breadthExtreme.setKey("极限宽度");
            depth.setKey("深度");
            draught.setKey("吃水");
            lengthBetweenPerpendicularsLbp.setKey("柱间距");
            keelToMastHeight.setKey("桅杆高度");
            grossTonnage.setKey("总吨");
            compensatedGrossTonnageCgt.setKey("CGT补偿总吨");
            deadWeight.setKey("载重吨");
            lightDisplacementTonnage.setKey("船舶轻吨");
            displacement.setKey("排水量");
            netTonnage.setKey("净吨");
            panamaCanalNetTonnagePcnt.setKey("巴拿马净吨");
            suezCanalNetTonnageScnt.setKey("苏伊士净吨");

            if (ihsShipBase.getLengthOverallLoa() ==null){
                lengthOverallLoa.setValue("");
            }
            else {
                lengthOverallLoa.setValue(ihsShipBase.getLengthOverallLoa() +"m");
            }
            if (ihsShipBase.getLengthRegistered() ==null){
                lengthRegistered.setValue("");
            }
            else {
                lengthRegistered.setValue(ihsShipBase.getLengthRegistered().toString());
            }
            if (ihsShipBase.getBreadthMoulded() ==null){
                breadthMoulded.setValue("");
            }
            else {
                breadthMoulded.setValue(ihsShipBase.getBreadthMoulded() +"m");
            }
            if (ihsShipBase.getBreadthExtreme() ==null){
                breadthExtreme.setValue("");
            }
            else {
                breadthExtreme.setValue(ihsShipBase.getBreadthExtreme() +"m");
            }
            if (ihsShipBase.getDepth() ==null){
                depth.setValue("");
            }
            else {
                depth.setValue(ihsShipBase.getDepth() +"m");
            }
            if (ihsShipBase.getDraught() ==null){
                draught.setValue("");
            }
            else {
                draught.setValue(ihsShipBase.getDraught().toString());
            }
            if (ihsShipBase.getLengthBetweenPerpendicularsLbp() ==null){
                lengthBetweenPerpendicularsLbp.setValue("");
            }
            else {
                lengthBetweenPerpendicularsLbp.setValue(ihsShipBase.getLengthBetweenPerpendicularsLbp() +"m");
            }
            if (ihsShipBase.getKeelToMastHeight() ==null){
                keelToMastHeight.setValue("");
            }
            else {
                keelToMastHeight.setValue(ihsShipBase.getKeelToMastHeight() +"m");
            }
            if (ihsShipBase.getGrossTonnage() ==null){
                grossTonnage.setValue("");
            }
            else {
                grossTonnage.setValue(ihsShipBase.getGrossTonnage() +"T");
            }
            if (ihsShipBase.getCompensatedGrossTonnageCgt() ==null){
                compensatedGrossTonnageCgt.setValue("");
            }
            else {
                compensatedGrossTonnageCgt.setValue(ihsShipBase.getCompensatedGrossTonnageCgt().toString());
            }
            if (ihsShipBase.getDeadWeight() ==null){
                deadWeight.setValue("");
            }
            else {
                deadWeight.setValue(ihsShipBase.getDeadWeight() +"T");
            }
            if (ihsShipBase.getLightDisplacementTonnage() ==null){
                lightDisplacementTonnage.setValue("");
            }
            else {
                lightDisplacementTonnage.setValue(ihsShipBase.getLightDisplacementTonnage() +"T");
            }
            if (ihsShipBase.getDisplacement() ==null){
                displacement.setValue("");
            }
            else {
                displacement.setValue(ihsShipBase.getDisplacement() +"T");
            }
            if (ihsShipBase.getNetTonnage() ==null){
                netTonnage.setValue("");
            }
            else {
                netTonnage.setValue(ihsShipBase.getNetTonnage() +"T");
            }
            if (ihsShipBase.getPanamaCanalNetTonnagePcnt() ==null){
                panamaCanalNetTonnagePcnt.setValue("");
            }
            else {
                panamaCanalNetTonnagePcnt.setValue(ihsShipBase.getPanamaCanalNetTonnagePcnt() +"T");
            }
            if (ihsShipBase.getSuezCanalNetTonnageScnt() ==null){
                suezCanalNetTonnageScnt.setValue("");
            }
            else {
                suezCanalNetTonnageScnt.setValue(ihsShipBase.getSuezCanalNetTonnageScnt() +"T");
            }

            lengthOverallLoa.setType("input");
            lengthRegistered.setType("input");
            breadthMoulded.setType("input");
            breadthExtreme.setType("input");
            depth.setType("input");
            draught.setType("input");
            lengthBetweenPerpendicularsLbp.setType("input");
            keelToMastHeight.setType("input");
            grossTonnage.setType("input");
            compensatedGrossTonnageCgt.setType("input");
            deadWeight.setType("input");
            lightDisplacementTonnage.setType("input");
            displacement.setType("input");
            netTonnage.setType("input");
            panamaCanalNetTonnagePcnt.setType("input");
            suezCanalNetTonnageScnt.setType("input");

            lengthOverallLoa.setDescribe("总长");
            lengthRegistered.setDescribe("注册长度");
            breadthMoulded.setDescribe("型宽");
            breadthExtreme.setDescribe("极限宽度");
            depth.setDescribe("深度");
            draught.setDescribe("吃水");
            lengthBetweenPerpendicularsLbp.setDescribe("柱间距");
            keelToMastHeight.setDescribe("桅杆高度");
            grossTonnage.setDescribe("总吨");
            compensatedGrossTonnageCgt.setDescribe("CGT补偿总吨");
            deadWeight.setDescribe("载重吨");
            lightDisplacementTonnage.setDescribe("船舶轻吨");
            displacement.setDescribe("排水量");
            netTonnage.setDescribe("净吨");
            panamaCanalNetTonnagePcnt.setDescribe("巴拿马净吨");
            suezCanalNetTonnageScnt.setDescribe("苏伊士净吨");

            mainParameterData.add(lengthOverallLoa);
            mainParameterData.add(lengthRegistered);
            mainParameterData.add(breadthMoulded);
            mainParameterData.add(breadthExtreme);
            mainParameterData.add(depth);
            mainParameterData.add(draught);
            mainParameterData.add(lengthBetweenPerpendicularsLbp);
            mainParameterData.add(keelToMastHeight);
            mainParameterData.add(grossTonnage);
            mainParameterData.add(compensatedGrossTonnageCgt);
            mainParameterData.add(deadWeight);
            mainParameterData.add(lightDisplacementTonnage);
            mainParameterData.add(displacement);
            mainParameterData.add(netTonnage);
            mainParameterData.add(panamaCanalNetTonnagePcnt);
            mainParameterData.add(suezCanalNetTonnageScnt);

            mainParameter.setData(mainParameterData);
            shipReportDetailVOS.add(mainParameter);
            //主机信息 hostInformation
            IhsShipBaseDetailVO hostInformation = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> hostInformationData = new ArrayList<>();
            hostInformation.setTitle("主机信息");
            hostInformation.setId("hostInformation");
            hostInformation.setFormatType(1);

            ShipReportDetailDataVO mainEngineType  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO numberOfAllEngines  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO mainEngineModel  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO mainEngineStrokeType  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO powerKwMax  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO powerKwService  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO mainEngineRpm  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO totalHorsepowerOfMainEngines  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO mainEngineNumberOfCylinders  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO mainEngineBore  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO totalKilowattsOfMainEngines  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO mainEngineDesignerGroup  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO mainEngineDesignerGroupCode  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO mainEngineBuilder  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO mainEngineBuilderCode  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO mainEngineDesigner  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO mainEngineDesignerCode  = new ShipReportDetailDataVO();

            mainEngineType.setKey("主机类型");
            numberOfAllEngines.setKey("主机数量");
            mainEngineModel.setKey("主机型号");
            mainEngineStrokeType.setKey("主机活塞类型");
            powerKwMax.setKey("主机最大功率");
            powerKwService.setKey("主机服务功率");
            mainEngineRpm.setKey("主机额定转速");
            totalHorsepowerOfMainEngines.setKey("主机总马力数");
            mainEngineNumberOfCylinders.setKey("主机气缸数量");
            mainEngineBore.setKey("主机缸径");
            totalKilowattsOfMainEngines.setKey("主机总功率数");
            mainEngineDesignerGroup.setKey("主机设计公司");
            mainEngineDesignerGroupCode.setKey("主机设计公司代码");
            mainEngineBuilder.setKey("主机制造商");
            mainEngineBuilderCode.setKey("主机制造商代码");
            mainEngineDesigner.setKey("主机设计方");
            mainEngineDesignerCode.setKey("主机设计方代码");

            if (ihsShipBase.getMainEngineType() ==null){
                mainEngineType.setValue("");
            }
            else {
                mainEngineType.setValue(ihsShipBase.getMainEngineType());
            }
            if (ihsShipBase.getNumberOfAllEngines() ==null){
                numberOfAllEngines.setValue("");
            }
            else {
                numberOfAllEngines.setValue(ihsShipBase.getNumberOfAllEngines().toString());
            }
            if (ihsShipBase.getMainEngineModel() ==null){
                mainEngineModel.setValue("");
            }
            else {
                mainEngineModel.setValue(ihsShipBase.getMainEngineModel());
            }
            if (ihsShipBase.getMainEngineStrokeType() ==null){
                mainEngineStrokeType.setValue("");
            }
            else {
                mainEngineStrokeType.setValue(ihsShipBase.getMainEngineStrokeType());
            }
            if (ihsShipBase.getPowerKwMax() ==null){
                powerKwMax.setValue("");
            }
            else {
                powerKwMax.setValue(ihsShipBase.getPowerKwMax().toString());
            }
            if (ihsShipBase.getPowerKwService() ==null){
                powerKwService.setValue("");
            }
            else {
                powerKwService.setValue(ihsShipBase.getPowerKwService().toString());
            }
            if (ihsShipBase.getMainEngineRpm() ==null){
                mainEngineRpm.setValue("");
            }
            else {
                mainEngineRpm.setValue(ihsShipBase.getMainEngineRpm().toString());
            }
            if (ihsShipBase.getTotalHorsepowerOfMainEngines() ==null){
                totalHorsepowerOfMainEngines.setValue("");
            }
            else {
                totalHorsepowerOfMainEngines.setValue(ihsShipBase.getTotalHorsepowerOfMainEngines().toString());
            }
            if (ihsShipBase.getMainEngineNumberOfCylinders() ==null){
                mainEngineNumberOfCylinders.setValue("");
            }
            else {
                mainEngineNumberOfCylinders.setValue(ihsShipBase.getMainEngineNumberOfCylinders().toString());
            }
            if (ihsShipBase.getMainEngineBore() ==null){
                mainEngineBore.setValue("");
            }
            else {
                mainEngineBore.setValue(ihsShipBase.getMainEngineBore().toString());
            }
            if (ihsShipBase.getTotalKilowattsOfMainEngines() ==null){
                totalKilowattsOfMainEngines.setValue("");
            }
            else {
                totalKilowattsOfMainEngines.setValue(ihsShipBase.getTotalKilowattsOfMainEngines().toString());
            }
            if (ihsShipBase.getMainEngineDesignerGroup() ==null){
                mainEngineDesignerGroup.setValue("");
            }
            else {
                mainEngineDesignerGroup.setValue(ihsShipBase.getMainEngineDesignerGroup());
            }
            if (ihsShipBase.getMainEngineDesignerGroupCode() ==null){
                mainEngineDesignerGroupCode.setValue("");
            }
            else {
                mainEngineDesignerGroupCode.setValue(ihsShipBase.getMainEngineDesignerGroupCode());
            }
            if (ihsShipBase.getMainEngineBuilder() ==null){
                mainEngineBuilder.setValue("");
            }
            else {
                mainEngineBuilder.setValue(ihsShipBase.getMainEngineBuilder());
            }
            if (ihsShipBase.getMainEngineBuilderCode() ==null){
                mainEngineBuilderCode.setValue("");
            }
            else {
                mainEngineBuilderCode.setValue(ihsShipBase.getMainEngineBuilderCode());
            }
            if (ihsShipBase.getMainEngineDesigner() ==null){
                mainEngineDesigner.setValue("");
            }
            else {
                mainEngineDesigner.setValue(ihsShipBase.getMainEngineDesigner());
            }
            if (ihsShipBase.getMainEngineDesignerCode() ==null){
                mainEngineDesignerCode.setValue("");
            }
            else {
                mainEngineDesignerCode.setValue(ihsShipBase.getMainEngineDesignerCode());
            }

            mainEngineType.setType("input");
            numberOfAllEngines.setType("input");
            mainEngineModel.setType("input");
            mainEngineStrokeType.setType("input");
            powerKwMax.setType("input");
            powerKwService.setType("input");
            mainEngineRpm.setType("input");
            totalHorsepowerOfMainEngines.setType("input");
            mainEngineNumberOfCylinders.setType("input");
            mainEngineBore.setType("input");
            totalKilowattsOfMainEngines.setType("input");
            mainEngineDesignerGroup.setType("input");
            mainEngineDesignerGroupCode.setType("input");
            mainEngineBuilder.setType("input");
            mainEngineBuilderCode.setType("input");
            mainEngineDesigner.setType("input");
            mainEngineDesignerCode.setType("input");

            mainEngineType.setDescribe("主机类型");
            numberOfAllEngines.setDescribe("主机数量");
            mainEngineModel.setDescribe("主机型号");
            mainEngineStrokeType.setDescribe("主机活塞类型");
            powerKwMax.setDescribe("主机最大功率");
            powerKwService.setDescribe("主机服务功率");
            mainEngineRpm.setDescribe("主机额定转速");
            totalHorsepowerOfMainEngines.setDescribe("主机总马力数");
            mainEngineNumberOfCylinders.setDescribe("主机气缸数量");
            mainEngineBore.setDescribe("主机缸径");
            totalKilowattsOfMainEngines.setDescribe("主机总功率数");
            mainEngineDesignerGroup.setDescribe("主机设计公司");
            mainEngineDesignerGroupCode.setDescribe("主机设计公司代码");
            mainEngineBuilder.setDescribe("主机制造商");
            mainEngineBuilderCode.setDescribe("主机制造商代码");
            mainEngineDesigner.setDescribe("主机设计方");
            mainEngineDesignerCode.setDescribe("主机设计方代码");

            hostInformationData.add(mainEngineType);
            hostInformationData.add(numberOfAllEngines);
            hostInformationData.add(mainEngineModel);
            hostInformationData.add(mainEngineStrokeType);
            hostInformationData.add(powerKwMax);
            hostInformationData.add(powerKwService);
            hostInformationData.add(mainEngineRpm);
            hostInformationData.add(totalHorsepowerOfMainEngines);
            hostInformationData.add(mainEngineNumberOfCylinders);
            hostInformationData.add(mainEngineBore);
            hostInformationData.add(totalKilowattsOfMainEngines);
            hostInformationData.add(mainEngineDesignerGroup);
            hostInformationData.add(mainEngineDesignerGroupCode);
            hostInformationData.add(mainEngineBuilder);
            hostInformationData.add(mainEngineBuilderCode);
            hostInformationData.add(mainEngineDesigner);
            hostInformationData.add(mainEngineDesignerCode);

            hostInformation.setData(hostInformationData);
            shipReportDetailVOS.add(hostInformation);
            //动力信息 powerInformation
            IhsShipBaseDetailVO powerInformation = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> powerInformationData = new ArrayList<>();
            powerInformation.setTitle("动力信息");
            powerInformation.setId("powerInformation");
            powerInformation.setFormatType(1);

            ShipReportDetailDataVO totalPowerOfAllEngines  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO linesPerSide  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO powerBhpIhpShpService  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO numberOfGenerators  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO totalHorsepowerOfMainGenerators  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO totalPowerOfAuxiliaryEngines  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO totalHorsepowerOfAuxiliaryGenerators  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO powerBhpIhpShpMax  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO auxiliaryGeneratorsDescriptiveNarrative  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO auxiliaryEnginesNarrative  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO primeMoverDescriptiveOverviewNarrative  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO primeMoverDescriptiveNarrative  = new ShipReportDetailDataVO();

            totalPowerOfAllEngines.setKey("发动机总功率");
            linesPerSide.setKey("管线数量");
            powerBhpIhpShpService.setKey("船舶运营马力");
            numberOfGenerators.setKey("发电机数");
            totalHorsepowerOfMainGenerators.setKey("发电机总马力数");
            totalPowerOfAuxiliaryEngines.setKey("辅机总功率");
            totalHorsepowerOfAuxiliaryGenerators.setKey("辅机总马力数");
            powerBhpIhpShpMax.setKey("船舶最大马力");
            auxiliaryGeneratorsDescriptiveNarrative.setKey("辅助发电机详细描述");
            auxiliaryEnginesNarrative.setKey("辅助发电机描述详细说明");
            primeMoverDescriptiveOverviewNarrative.setKey("主推概述");
            primeMoverDescriptiveNarrative.setKey("主推详情描述");

            if (ihsShipBase.getTotalPowerOfAllEngines() ==null){
                totalPowerOfAllEngines.setValue("");
            }
            else {
                totalPowerOfAllEngines.setValue(ihsShipBase.getTotalPowerOfAllEngines().toString());
            }
            if (ihsShipBase.getLinesPerSide() ==null){
                linesPerSide.setValue("");
            }
            else {
                linesPerSide.setValue(ihsShipBase.getLinesPerSide().toString());
            }
            if (ihsShipBase.getPowerBhpIhpShpService() ==null){
                powerBhpIhpShpService.setValue("");
            }
            else {
                powerBhpIhpShpService.setValue(ihsShipBase.getPowerBhpIhpShpService().toString());
            }
            if (ihsShipBase.getNumberOfGenerators() ==null){
                numberOfGenerators.setValue("");
            }
            else {
                numberOfGenerators.setValue(ihsShipBase.getNumberOfGenerators().toString());
            }
            if (ihsShipBase.getTotalHorsepowerOfMainGenerators() ==null){
                totalHorsepowerOfMainGenerators.setValue("");
            }
            else {
                totalHorsepowerOfMainGenerators.setValue(ihsShipBase.getTotalHorsepowerOfMainGenerators().toString());
            }
            if (ihsShipBase.getTotalPowerOfAuxiliaryEngines() ==null){
                totalPowerOfAuxiliaryEngines.setValue("");
            }
            else {
                totalPowerOfAuxiliaryEngines.setValue(ihsShipBase.getTotalPowerOfAuxiliaryEngines().toString());
            }
            if (ihsShipBase.getTotalHorsepowerOfAuxiliaryGenerators() ==null){
                totalHorsepowerOfAuxiliaryGenerators.setValue("");
            }
            else {
                totalHorsepowerOfAuxiliaryGenerators.setValue(ihsShipBase.getTotalHorsepowerOfAuxiliaryGenerators().toString());
            }
            if (ihsShipBase.getPowerBhpIhpShpMax() ==null){
                powerBhpIhpShpMax.setValue("");
            }
            else {
                powerBhpIhpShpMax.setValue(ihsShipBase.getPowerBhpIhpShpMax().toString());
            }
            if (ihsShipBase.getAuxiliaryGeneratorsDescriptiveNarrative() ==null){
                auxiliaryGeneratorsDescriptiveNarrative.setValue("");
            }
            else {
                auxiliaryGeneratorsDescriptiveNarrative.setValue(ihsShipBase.getAuxiliaryGeneratorsDescriptiveNarrative());
            }
            if (ihsShipBase.getAuxiliaryEnginesNarrative() ==null){
                auxiliaryEnginesNarrative.setValue("");
            }
            else {
                auxiliaryEnginesNarrative.setValue(ihsShipBase.getAuxiliaryEnginesNarrative());
            }
            if (ihsShipBase.getPrimeMoverDescriptiveOverviewNarrative() ==null){
                primeMoverDescriptiveOverviewNarrative.setValue("");
            }
            else {
                primeMoverDescriptiveOverviewNarrative.setValue(ihsShipBase.getPrimeMoverDescriptiveOverviewNarrative());
            }
            if (ihsShipBase.getPrimeMoverDescriptiveNarrative() ==null){
                primeMoverDescriptiveNarrative.setValue("");
            }
            else {
                primeMoverDescriptiveNarrative.setValue(ihsShipBase.getPrimeMoverDescriptiveNarrative());
            }

            totalPowerOfAllEngines.setType("input");
            linesPerSide.setType("input");
            powerBhpIhpShpService.setType("input");
            numberOfGenerators.setType("input");
            totalHorsepowerOfMainGenerators.setType("input");
            totalPowerOfAuxiliaryEngines.setType("input");
            totalHorsepowerOfAuxiliaryGenerators.setType("input");
            powerBhpIhpShpMax.setType("input");
            auxiliaryGeneratorsDescriptiveNarrative.setType("input");
            auxiliaryEnginesNarrative.setType("input");
            primeMoverDescriptiveOverviewNarrative.setType("input");
            primeMoverDescriptiveNarrative.setType("input");

            totalPowerOfAllEngines.setDescribe("发动机总功率");
            linesPerSide.setDescribe("管线数量");
            powerBhpIhpShpService.setDescribe("船舶运营马力");
            numberOfGenerators.setDescribe("发电机数");
            totalHorsepowerOfMainGenerators.setDescribe("发电机总马力数");
            totalPowerOfAuxiliaryEngines.setDescribe("辅机总功率");
            totalHorsepowerOfAuxiliaryGenerators.setDescribe("辅机总马力数");
            powerBhpIhpShpMax.setDescribe("船舶最大马力");
            auxiliaryGeneratorsDescriptiveNarrative.setDescribe("辅助发电机详细描述");
            auxiliaryEnginesNarrative.setDescribe("辅助发电机描述详细说明");
            primeMoverDescriptiveOverviewNarrative.setDescribe("主推概述");
            primeMoverDescriptiveNarrative.setDescribe("主推详情描述");

            powerInformationData.add(totalPowerOfAllEngines);
            powerInformationData.add(linesPerSide);
            powerInformationData.add(powerBhpIhpShpService);
            powerInformationData.add(numberOfGenerators);
            powerInformationData.add(totalHorsepowerOfMainGenerators);
            powerInformationData.add(totalPowerOfAuxiliaryEngines);
            powerInformationData.add(totalHorsepowerOfAuxiliaryGenerators);
            powerInformationData.add(powerBhpIhpShpMax);
            powerInformationData.add(auxiliaryGeneratorsDescriptiveNarrative);
            powerInformationData.add(auxiliaryEnginesNarrative);
            powerInformationData.add(primeMoverDescriptiveOverviewNarrative);
            powerInformationData.add(primeMoverDescriptiveNarrative);

            powerInformation.setData(powerInformationData);
            shipReportDetailVOS.add(powerInformation);
            //推进器 propeller
            IhsShipBaseDetailVO propeller = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> propellerData = new ArrayList<>();
            propeller.setTitle("推进器/螺旋桨");
            propeller.setId("propeller");
            propeller.setFormatType(1);

            ShipReportDetailDataVO numberOfThrusters  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO propulsionType  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO propulsionTypeCode  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO numberOfPropulsionUnits  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO thrustersDescriptiveNarrative  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO propellerManufacturer  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO propellerType  = new ShipReportDetailDataVO();

            numberOfThrusters.setKey("推进器数量");
            propulsionType.setKey("推进动力类型");
            propulsionTypeCode.setKey("推进动力代码");
            numberOfPropulsionUnits.setKey("推进单元数");
            thrustersDescriptiveNarrative.setKey("推进器描述");
            propellerManufacturer.setKey("螺旋桨制造商");
            propellerType.setKey("螺旋桨类型");

            if (ihsShipBase.getNumberOfThrusters() ==null){
                numberOfThrusters.setValue("");
            }
            else {
                numberOfThrusters.setValue(ihsShipBase.getNumberOfThrusters().toString());
            }
            if (ihsShipBase.getPropulsionType() ==null){
                propulsionType.setValue("");
            }
            else {
                propulsionType.setValue(ihsShipBase.getPropulsionType());
            }
            if (ihsShipBase.getPropulsionTypeCode() ==null){
                propulsionTypeCode.setValue("");
            }
            else {
                propulsionTypeCode.setValue(ihsShipBase.getPropulsionTypeCode());
            }
            if (ihsShipBase.getNumberOfPropulsionUnits() ==null){
                numberOfPropulsionUnits.setValue("");
            }
            else {
                numberOfPropulsionUnits.setValue(ihsShipBase.getNumberOfPropulsionUnits().toString());
            }
            if (ihsShipBase.getThrustersDescriptiveNarrative() ==null){
                thrustersDescriptiveNarrative.setValue("");
            }
            else {
                thrustersDescriptiveNarrative.setValue(ihsShipBase.getThrustersDescriptiveNarrative());
            }
            if (ihsShipBase.getPropellerManufacturer() ==null){
                propellerManufacturer.setValue("");
            }
            else {
                propellerManufacturer.setValue(ihsShipBase.getPropellerManufacturer());
            }
            if (ihsShipBase.getPropellerType() ==null){
                propellerType.setValue("");
            }
            else {
                propellerType.setValue(ihsShipBase.getPropellerType());
            }

            numberOfThrusters.setType("input");
            propulsionType.setType("input");
            propulsionTypeCode.setType("input");
            numberOfPropulsionUnits.setType("input");
            thrustersDescriptiveNarrative.setType("input");
            propellerManufacturer.setType("input");
            propellerType.setType("input");

            numberOfThrusters.setDescribe("推进器数量");
            propulsionType.setDescribe("推进动力类型");
            propulsionTypeCode.setDescribe("推进动力代码");
            numberOfPropulsionUnits.setDescribe("推进单元数");
            thrustersDescriptiveNarrative.setDescribe("推进器描述");
            propellerManufacturer.setDescribe("螺旋桨制造商");
            propellerType.setDescribe("螺旋桨类型");

            propellerData.add(numberOfThrusters);
            propellerData.add(propulsionType);
            propellerData.add(propulsionTypeCode);
            propellerData.add(numberOfPropulsionUnits);
            propellerData.add(thrustersDescriptiveNarrative);
            propellerData.add(propellerManufacturer);
            propellerData.add(propellerType);

            propeller.setData(propellerData);
            shipReportDetailVOS.add(propeller);
            //船型及舱室 shipTypeAndCabin
            IhsShipBaseDetailVO shipTypeAndCabin = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> shipTypeAndCabinData = new ArrayList<>();
            shipTypeAndCabin.setTitle("船型及舱室");
            shipTypeAndCabin.setId("shipTypeAndCabin");
            shipTypeAndCabin.setFormatType(1);

            ShipReportDetailDataVO shiptypeGroup  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO shipTypeLevel5  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO shipTypeLevel5SubGroup  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO shipTypeLevel5SubType  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO numberOfCargoPumps  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO pumpingCapacityM3  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO specialTanksDescriptiveNarrative  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO tempMinimum  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO cargoCapacitiesNarrative  = new ShipReportDetailDataVO();

            shiptypeGroup.setKey("船型");
            shipTypeLevel5.setKey("船型5");
            shipTypeLevel5SubGroup.setKey("船型5子组");
            shipTypeLevel5SubType.setKey("船型5子类型");
            numberOfCargoPumps.setKey("货舱泵数量");
            pumpingCapacityM3.setKey("泵排量");
            specialTanksDescriptiveNarrative.setKey("特殊舱室描述");
            tempMinimum.setKey("货舱最低温度");
            cargoCapacitiesNarrative.setKey("舱容描述");

            if (ihsShipBase.getShipTypeGroup() ==null){
                shiptypeGroup.setValue("");
            }
            else {
                shiptypeGroup.setValue(ihsShipBase.getShipTypeGroup());
            }
            if (ihsShipBase.getShipTypeLevel5() ==null){
                shipTypeLevel5.setValue("");
            }
            else {
                shipTypeLevel5.setValue(ihsShipBase.getShipTypeLevel5());
            }
            if (ihsShipBase.getShipTypeLevel5SubGroup() ==null){
                shipTypeLevel5SubGroup.setValue("");
            }
            else {
                shipTypeLevel5SubGroup.setValue(ihsShipBase.getShipTypeLevel5SubGroup());
            }
            if (ihsShipBase.getShipTypeLevel5SubType() ==null){
                shipTypeLevel5SubType.setValue("");
            }
            else {
                shipTypeLevel5SubType.setValue(ihsShipBase.getShipTypeLevel5SubType());
            }
            if (ihsShipBase.getNumberOfCargoPumps() ==null){
                numberOfCargoPumps.setValue("");
            }
            else {
                numberOfCargoPumps.setValue(ihsShipBase.getNumberOfCargoPumps().toString());
            }
            if (ihsShipBase.getPumpingCapacityM3() ==null){
                pumpingCapacityM3.setValue("");
            }
            else {
                pumpingCapacityM3.setValue(ihsShipBase.getPumpingCapacityM3().toString());
            }
            if (ihsShipBase.getSpecialTanksDescriptiveNarrative() ==null){
                specialTanksDescriptiveNarrative.setValue("");
            }
            else {
                specialTanksDescriptiveNarrative.setValue(ihsShipBase.getSpecialTanksDescriptiveNarrative());
            }
            if (ihsShipBase.getTempMinimum() ==null){
                tempMinimum.setValue("");
            }
            else {
                tempMinimum.setValue(ihsShipBase.getTempMinimum().toString());
            }
            if (ihsShipBase.getCargoCapacitiesNarrative() ==null){
                cargoCapacitiesNarrative.setValue("");
            }
            else {
                cargoCapacitiesNarrative.setValue(ihsShipBase.getCargoCapacitiesNarrative());
            }

            shiptypeGroup.setType("input");
            shipTypeLevel5.setType("input");
            shipTypeLevel5SubGroup.setType("input");
            shipTypeLevel5SubType.setType("input");
            numberOfCargoPumps.setType("input");
            pumpingCapacityM3.setType("input");
            specialTanksDescriptiveNarrative.setType("input");
            tempMinimum.setType("input");
            cargoCapacitiesNarrative.setType("input");

            shiptypeGroup.setDescribe("船型");
            shipTypeLevel5.setDescribe("船型5");
            shipTypeLevel5SubGroup.setDescribe("船型5子组");
            shipTypeLevel5SubType.setDescribe("船型5子类型");
            numberOfCargoPumps.setDescribe("货舱泵数量");
            pumpingCapacityM3.setDescribe("泵排量");
            specialTanksDescriptiveNarrative.setDescribe("特殊舱室描述");
            tempMinimum.setDescribe("货舱最低温度");
            cargoCapacitiesNarrative.setDescribe("舱容描述");

            shipTypeAndCabinData.add(shiptypeGroup);
            shipTypeAndCabinData.add(shipTypeLevel5);
            shipTypeAndCabinData.add(shipTypeLevel5SubGroup);
            shipTypeAndCabinData.add(shipTypeLevel5SubType);
            shipTypeAndCabinData.add(numberOfCargoPumps);
            shipTypeAndCabinData.add(pumpingCapacityM3);
            shipTypeAndCabinData.add(specialTanksDescriptiveNarrative);
            shipTypeAndCabinData.add(tempMinimum);
            shipTypeAndCabinData.add(cargoCapacitiesNarrative);

            shipTypeAndCabin.setData(shipTypeAndCabinData);
            shipReportDetailVOS.add(shipTypeAndCabin);
            //注册信息 registrationInfo
            IhsShipBaseDetailVO registrationInfo = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> registrationInfoData = new ArrayList<>();
            registrationInfo.setTitle("注册信息");
            registrationInfo.setId("registrationInfo");
            registrationInfo.setFormatType(1);

            ShipReportDetailDataVO registeredOwner  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO registeredOwnerCode  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO registeredOwnerCountryOfControl  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO registeredOwnerCountryOfDomicile  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO registeredOwnerCountryOfRegistration  = new ShipReportDetailDataVO();

            registeredOwner.setKey("注册船东");
            registeredOwnerCode.setKey("注册船东编号");
            registeredOwnerCountryOfControl.setKey("注册所有人控制国");
            registeredOwnerCountryOfDomicile.setKey("注册所有人住所国");
            registeredOwnerCountryOfRegistration.setKey("注册所有人注册国");

            if (ihsShipBase.getRegisteredOwner() ==null){
                registeredOwner.setValue("");
            }
            else {
                registeredOwner.setValue(ihsShipBase.getRegisteredOwner());
            }
            if (ihsShipBase.getRegisteredOwnerCode() ==null){
                registeredOwnerCode.setValue("");
            }
            else {
                registeredOwnerCode.setValue(ihsShipBase.getRegisteredOwnerCode());
            }
            if (ihsShipBase.getRegisteredOwnerCountryOfControl() ==null){
                registeredOwnerCountryOfControl.setValue("");
            }
            else {
                registeredOwnerCountryOfControl.setValue(ihsShipBase.getRegisteredOwnerCountryOfControl());
            }
            if (ihsShipBase.getRegisteredOwnerCountryOfDomicile() ==null){
                registeredOwnerCountryOfDomicile.setValue("");
            }
            else {
                registeredOwnerCountryOfDomicile.setValue(ihsShipBase.getRegisteredOwnerCountryOfDomicile());
            }
            if (ihsShipBase.getRegisteredOwnerCountryOfRegistration() ==null){
                registeredOwnerCountryOfRegistration.setValue("");
            }
            else {
                registeredOwnerCountryOfRegistration.setValue(ihsShipBase.getRegisteredOwnerCountryOfRegistration());
            }

            registeredOwner.setType("input");
            registeredOwnerCode.setType("input");
            registeredOwnerCountryOfControl.setType("input");
            registeredOwnerCountryOfDomicile.setType("input");
            registeredOwnerCountryOfRegistration.setType("input");

            registeredOwner.setDescribe("注册船东");
            registeredOwnerCode.setDescribe("注册船东编号");
            registeredOwnerCountryOfControl.setDescribe("注册所有人控制国");
            registeredOwnerCountryOfDomicile.setDescribe("注册所有人住所国");
            registeredOwnerCountryOfRegistration.setDescribe("注册所有人注册国");

            registrationInfoData.add(registeredOwner);
            registrationInfoData.add(registeredOwnerCode);
            registrationInfoData.add(registeredOwnerCountryOfControl);
            registrationInfoData.add(registeredOwnerCountryOfDomicile);
            registrationInfoData.add(registeredOwnerCountryOfRegistration);

            registrationInfo.setData(registrationInfoData);
            shipReportDetailVOS.add(registrationInfo);
            //技术管理人 technicalManager
            IhsShipBaseDetailVO technicalManagers = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> technicalManagerData = new ArrayList<>();
            technicalManagers.setTitle("技术管理人");
            technicalManagers.setId("technicalManager");
            technicalManagers.setFormatType(1);

            ShipReportDetailDataVO technicalManager  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO technicalManagerCode  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO technicalManagerCountryOfControl  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO technicalManagerCountryOfDomicile  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO technicalManagerCountryOfRegistration  = new ShipReportDetailDataVO();

            technicalManager.setKey("技术管理方");
            technicalManagerCode.setKey("技术管理方代码");
            technicalManagerCountryOfControl.setKey("技术管理方控制国");
            technicalManagerCountryOfDomicile.setKey("技术管理方住所国");
            technicalManagerCountryOfRegistration.setKey("技术管理方注册国");

            if (ihsShipBase.getTechnicalManager() ==null){
                technicalManager.setValue("");
            }
            else {
                technicalManager.setValue(ihsShipBase.getTechnicalManager());
            }
            if (ihsShipBase.getTechnicalManagerCode() ==null){
                technicalManagerCode.setValue("");
            }
            else {
                technicalManagerCode.setValue(ihsShipBase.getTechnicalManagerCode());
            }
            if (ihsShipBase.getTechnicalManagerCountryOfControl() ==null){
                technicalManagerCountryOfControl.setValue("");
            }
            else {
                technicalManagerCountryOfControl.setValue(ihsShipBase.getTechnicalManagerCountryOfControl());
            }
            if (ihsShipBase.getTechnicalManagerCountryOfDomicile() ==null){
                technicalManagerCountryOfDomicile.setValue("");
            }
            else {
                technicalManagerCountryOfDomicile.setValue(ihsShipBase.getTechnicalManagerCountryOfDomicile());
            }
            if (ihsShipBase.getTechnicalManagerCountryOfRegistration() ==null){
                technicalManagerCountryOfRegistration.setValue("");
            }
            else {
                technicalManagerCountryOfRegistration.setValue(ihsShipBase.getTechnicalManagerCountryOfRegistration());
            }


            technicalManager.setType("input");
            technicalManagerCode.setType("input");
            technicalManagerCountryOfControl.setType("input");
            technicalManagerCountryOfDomicile.setType("input");
            technicalManagerCountryOfRegistration.setType("input");

            technicalManager.setDescribe("技术管理方");
            technicalManagerCode.setDescribe("技术管理方代码");
            technicalManagerCountryOfControl.setDescribe("技术管理方控制国");
            technicalManagerCountryOfDomicile.setDescribe("技术管理方住所国");
            technicalManagerCountryOfRegistration.setDescribe("技术管理方注册国");

            technicalManagerData.add(technicalManager);
            technicalManagerData.add(technicalManagerCode);
            technicalManagerData.add(technicalManagerCountryOfControl);
            technicalManagerData.add(technicalManagerCountryOfDomicile);
            technicalManagerData.add(technicalManagerCountryOfRegistration);

            technicalManagers.setData(technicalManagerData);
            shipReportDetailVOS.add(technicalManagers);
            //船舶管理人 shipManager
            IhsShipBaseDetailVO shipManagers = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> shipManagerData = new ArrayList<>();
            shipManagers.setTitle("船舶管理人");
            shipManagers.setId("shipManager");
            shipManagers.setFormatType(1);

            ShipReportDetailDataVO shipManager  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO shipManagerCompanyCode  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO shipManagerCountryOfControl  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO shipManagerCountryOfRegistration  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO shipManagerCountryOfDomicileName  = new ShipReportDetailDataVO();

            shipManager.setKey("船管方");
            shipManagerCompanyCode.setKey("船管公司代码");
            shipManagerCountryOfControl.setKey("船管住所国");
            shipManagerCountryOfRegistration.setKey("船管注册国");
            shipManagerCountryOfDomicileName.setKey("船管控制国");

            if (ihsShipBase.getShipManager() ==null){
                shipManager.setValue("");
            }
            else {
                shipManager.setValue(ihsShipBase.getShipManager());
            }
            if (ihsShipBase.getShipManagerCompanyCode() ==null){
                shipManagerCompanyCode.setValue("");
            }
            else {
                shipManagerCompanyCode.setValue(ihsShipBase.getShipManagerCompanyCode());
            }
            if (ihsShipBase.getShipManagerCountryOfControl() ==null){
                shipManagerCountryOfControl.setValue("");
            }
            else {
                shipManagerCountryOfControl.setValue(ihsShipBase.getShipManagerCountryOfControl());
            }
            if (ihsShipBase.getShipManagerCountryOfRegistration() ==null){
                shipManagerCountryOfRegistration.setValue("");
            }
            else {
                shipManagerCountryOfRegistration.setValue(ihsShipBase.getShipManagerCountryOfRegistration());
            }
            if (ihsShipBase.getShipManagerCountryOfDomicileName() ==null){
                shipManagerCountryOfDomicileName.setValue("");
            }
            else {
                shipManagerCountryOfDomicileName.setValue(ihsShipBase.getShipManagerCountryOfDomicileName());
            }

            shipManager.setType("input");
            shipManagerCompanyCode.setType("input");
            shipManagerCountryOfControl.setType("input");
            shipManagerCountryOfRegistration.setType("input");
            shipManagerCountryOfDomicileName.setType("input");

            shipManager.setDescribe("船管方");
            shipManagerCompanyCode.setDescribe("船管公司代码");
            shipManagerCountryOfControl.setDescribe("船管住所国");
            shipManagerCountryOfRegistration.setDescribe("船管注册国");
            shipManagerCountryOfDomicileName.setDescribe("船管控制国");

            shipManagerData.add(shipManager);
            shipManagerData.add(shipManagerCompanyCode);
            shipManagerData.add(shipManagerCountryOfControl);
            shipManagerData.add(shipManagerCountryOfRegistration);
            shipManagerData.add(shipManagerCountryOfDomicileName);

            shipManagers.setData(shipManagerData);
            shipReportDetailVOS.add(shipManagers);
            //安全管理证书信息 securityManageCert
            IhsShipBaseDetailVO securityManageCert = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> securityManageCertData = new ArrayList<>();
            securityManageCert.setTitle("安全管理证书信息");
            securityManageCert.setId("securityManageCert");
            securityManageCert.setFormatType(1);

            ShipReportDetailDataVO docCompany  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO docCompanyCountryOfDomicile  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO docCountryOfControl  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO docCountryOfRegistration  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO safetyManagementCertificateAuditor  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO safetyManagementCertificateConventionorVol  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO safetyManagementCertificateDateIssued  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO safetyManagementCertificateDateExpires  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO safetyManagementCertificateDocCompany  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO safetyManagementCertificateFlag  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO safetyManagementCertificateIssuer  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO safetyManagementCertificateSource  = new ShipReportDetailDataVO();

            docCompany.setKey("DOC公司");
            docCompanyCountryOfDomicile.setKey("DOC公司所在国");
            docCountryOfControl.setKey("DOC企业管辖国");
            docCountryOfRegistration.setKey("DOC企业等级国");
            safetyManagementCertificateAuditor.setKey("安全管理证书审计");
            safetyManagementCertificateConventionorVol.setKey("安全管理证书");
            safetyManagementCertificateDateIssued.setKey("安全管理证书签发日期");
            safetyManagementCertificateDateExpires.setKey("安全管理证书有效期截至");
            safetyManagementCertificateDocCompany.setKey("安全管理证书所属DOC公司");
            safetyManagementCertificateFlag.setKey("安全管理证书船旗");
            safetyManagementCertificateIssuer.setKey("安全管理证书签发人");
            safetyManagementCertificateSource.setKey("安全管理证书来源");

            if (ihsShipBase.getDocCompany() ==null){
                docCompany.setValue("");
            }
            else {
                docCompany.setValue(ihsShipBase.getDocCompany());
            }
            if (ihsShipBase.getDocCompanyCountryOfDomicile() ==null){
                docCompanyCountryOfDomicile.setValue("");
            }
            else {
                docCompanyCountryOfDomicile.setValue(ihsShipBase.getDocCompanyCountryOfDomicile());
            }
            if (ihsShipBase.getDocCountryOfControl() ==null){
                docCountryOfControl.setValue("");
            }
            else {
                docCountryOfControl.setValue(ihsShipBase.getDocCountryOfControl());
            }
            if (ihsShipBase.getDocCountryOfRegistration() ==null){
                docCountryOfRegistration.setValue("");
            }
            else {
                docCountryOfRegistration.setValue(ihsShipBase.getDocCountryOfRegistration());
            }
            if (ihsShipBase.getSafetyManagementCertificateAuditor() ==null){
                safetyManagementCertificateAuditor.setValue("");
            }
            else {
                safetyManagementCertificateAuditor.setValue(ihsShipBase.getSafetyManagementCertificateAuditor());
            }
            if (ihsShipBase.getSafetyManagementCertificateConventionorVol() ==null){
                safetyManagementCertificateConventionorVol.setValue("");
            }
            else {
                safetyManagementCertificateConventionorVol.setValue(ihsShipBase.getSafetyManagementCertificateConventionorVol());
            }
            if (ihsShipBase.getSafetyManagementCertificateDateIssued() ==null){
                safetyManagementCertificateDateIssued.setValue("");
            }
            else {
                safetyManagementCertificateDateIssued.setValue(ihsShipBase.getSafetyManagementCertificateDateIssued());
            }
            if (ihsShipBase.getSafetyManagementCertificateDateExpires() ==null){
                safetyManagementCertificateDateExpires.setValue("");
            }
            else {
                safetyManagementCertificateDateExpires.setValue(ihsShipBase.getSafetyManagementCertificateDateExpires());
            }
            if (ihsShipBase.getSafetyManagementCertificateDocCompany() ==null){
                safetyManagementCertificateDocCompany.setValue("");
            }
            else {
                safetyManagementCertificateDocCompany.setValue(ihsShipBase.getSafetyManagementCertificateDocCompany());
            }
            if (ihsShipBase.getSafetyManagementCertificateFlag() ==null){
                safetyManagementCertificateFlag.setValue("");
            }
            else {
                safetyManagementCertificateFlag.setValue(ihsShipBase.getSafetyManagementCertificateFlag());
            }
            if (ihsShipBase.getSafetyManagementCertificateIssuer() ==null){
                safetyManagementCertificateIssuer.setValue("");
            }
            else {
                safetyManagementCertificateIssuer.setValue(ihsShipBase.getSafetyManagementCertificateIssuer());
            }
            if (ihsShipBase.getSafetyManagementCertificateSource() ==null){
                safetyManagementCertificateSource.setValue("");
            }
            else {
                safetyManagementCertificateSource.setValue(ihsShipBase.getSafetyManagementCertificateSource());
            }

            docCompany.setType("input");
            docCompanyCountryOfDomicile.setType("input");
            docCountryOfControl.setType("input");
            docCountryOfRegistration.setType("input");
            safetyManagementCertificateAuditor.setType("input");
            safetyManagementCertificateConventionorVol.setType("input");
            safetyManagementCertificateDateIssued.setType("input");
            safetyManagementCertificateDateExpires.setType("input");
            safetyManagementCertificateDocCompany.setType("input");
            safetyManagementCertificateFlag.setType("input");
            safetyManagementCertificateIssuer.setType("input");
            safetyManagementCertificateSource.setType("input");

            docCompany.setDescribe("DOC公司");
            docCompanyCountryOfDomicile.setDescribe("DOC公司所在国");
            docCountryOfControl.setDescribe("DOC企业管辖国");
            docCountryOfRegistration.setDescribe("DOC企业等级国");
            safetyManagementCertificateAuditor.setDescribe("安全管理证书审计");
            safetyManagementCertificateConventionorVol.setDescribe("安全管理证书");
            safetyManagementCertificateDateIssued.setDescribe("安全管理证书签发日期");
            safetyManagementCertificateDateExpires.setDescribe("安全管理证书有效期截至");
            safetyManagementCertificateDocCompany.setDescribe("安全管理证书所属DOC公司");
            safetyManagementCertificateFlag.setDescribe("安全管理证书船旗");
            safetyManagementCertificateIssuer.setDescribe("安全管理证书签发人");
            safetyManagementCertificateSource.setDescribe("安全管理证书来源");

            securityManageCertData.add(docCompany);
            securityManageCertData.add(docCompanyCountryOfDomicile);
            securityManageCertData.add(docCountryOfControl);
            securityManageCertData.add(docCountryOfRegistration);
            securityManageCertData.add(safetyManagementCertificateAuditor);
            securityManageCertData.add(safetyManagementCertificateConventionorVol);
            securityManageCertData.add(safetyManagementCertificateDateIssued);
            securityManageCertData.add(safetyManagementCertificateDateExpires);
            securityManageCertData.add(safetyManagementCertificateDocCompany);
            securityManageCertData.add(safetyManagementCertificateFlag);
            securityManageCertData.add(safetyManagementCertificateIssuer);
            securityManageCertData.add(safetyManagementCertificateSource);

            securityManageCert.setData(securityManageCertData);
            shipReportDetailVOS.add(securityManageCert);
            //经济利益 economicInterest
            IhsShipBaseDetailVO economicInterest = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> economicInterestData = new ArrayList<>();
            economicInterest.setTitle("经济利益");
            economicInterest.setId("economicInterest");
            economicInterest.setFormatType(1);
            ShipReportDetailDataVO groupBeneficialOwner  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO groupBeneficialOwnerCompanyCode  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO groupBeneficialOwnerCountryOfControl  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO groupBeneficialOwnerCountryOfDomicile  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO groupBeneficialOwnerCountryOfRegistration  = new ShipReportDetailDataVO();

            groupBeneficialOwner.setKey("集团受益方");
            groupBeneficialOwnerCompanyCode.setKey("集团受益方编号");
            groupBeneficialOwnerCountryOfControl.setKey("集团受益方所在国");
            groupBeneficialOwnerCountryOfDomicile.setKey("集团受益方管辖国");
            groupBeneficialOwnerCountryOfRegistration.setKey("集团受益方登记国");

            if (ihsShipBase.getGroupBeneficialOwner() ==null){
                groupBeneficialOwner.setValue("");
            }
            else {
                groupBeneficialOwner.setValue(ihsShipBase.getGroupBeneficialOwner());
            }
            if (ihsShipBase.getGroupBeneficialOwnerCompanyCode() ==null){
                groupBeneficialOwnerCompanyCode.setValue("");
            }
            else {
                groupBeneficialOwnerCompanyCode.setValue(ihsShipBase.getGroupBeneficialOwnerCompanyCode());
            }
            if (ihsShipBase.getGroupBeneficialOwnerCountryOfControl() ==null){
                groupBeneficialOwnerCountryOfControl.setValue("");
            }
            else {
                groupBeneficialOwnerCountryOfControl.setValue(ihsShipBase.getGroupBeneficialOwnerCountryOfControl());
            }
            if (ihsShipBase.getGroupBeneficialOwnerCountryOfDomicile() ==null){
                groupBeneficialOwnerCountryOfDomicile.setValue("");
            }
            else {
                groupBeneficialOwnerCountryOfDomicile.setValue(ihsShipBase.getGroupBeneficialOwnerCountryOfDomicile());
            }
            if (ihsShipBase.getGroupBeneficialOwnerCountryOfRegistration() ==null){
                groupBeneficialOwnerCountryOfRegistration.setValue("");
            }
            else {
                groupBeneficialOwnerCountryOfRegistration.setValue(ihsShipBase.getGroupBeneficialOwnerCountryOfRegistration());
            }

            groupBeneficialOwner.setType("input");
            groupBeneficialOwnerCompanyCode.setType("input");
            groupBeneficialOwnerCountryOfControl.setType("input");
            groupBeneficialOwnerCountryOfDomicile.setType("input");
            groupBeneficialOwnerCountryOfRegistration.setType("input");

            groupBeneficialOwner.setDescribe("集团受益方");
            groupBeneficialOwnerCompanyCode.setDescribe("集团受益方编号");
            groupBeneficialOwnerCountryOfControl.setDescribe("集团受益方所在国");
            groupBeneficialOwnerCountryOfDomicile.setDescribe("集团受益方管辖国");
            groupBeneficialOwnerCountryOfRegistration.setDescribe("集团受益方登记国");

            economicInterestData.add(groupBeneficialOwner);
            economicInterestData.add(groupBeneficialOwnerCompanyCode);
            economicInterestData.add(groupBeneficialOwnerCountryOfControl);
            economicInterestData.add(groupBeneficialOwnerCountryOfDomicile);
            economicInterestData.add(groupBeneficialOwnerCountryOfRegistration);

            economicInterest.setData(economicInterestData);
            shipReportDetailVOS.add(economicInterest);
            //船舶经营 shipOperation
            IhsShipBaseDetailVO shipOperation = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> shipOperationData = new ArrayList<>();
            shipOperation.setTitle("船舶经营");
            shipOperation.setId("shipOperation");
            shipOperation.setFormatType(1);

            ShipReportDetailDataVO operator  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO operatorCompanyCode  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO operatorCountryOfControl  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO operatorCountryOfDomicileName  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO operatorCountryOfRegistration  = new ShipReportDetailDataVO();

            operator.setKey("船管经营公司");
            operatorCompanyCode.setKey("船管经营公司编码");
            operatorCountryOfControl.setKey("船管经营公司所在国");
            operatorCountryOfDomicileName.setKey("船管经营公司管辖国");
            operatorCountryOfRegistration.setKey("船管经营公司注册国");

            if (ihsShipBase.getOperator() ==null){
                operator.setValue("");
            }
            else {
                operator.setValue(ihsShipBase.getOperator());
            }
            if (ihsShipBase.getOperatorCompanyCode() ==null){
                operatorCompanyCode.setValue("");
            }
            else {
                operatorCompanyCode.setValue(ihsShipBase.getOperatorCompanyCode());
            }
            if (ihsShipBase.getOperatorCountryOfControl() ==null){
                operatorCountryOfControl.setValue("");
            }
            else {
                operatorCountryOfControl.setValue(ihsShipBase.getOperatorCountryOfControl());
            }
            if (ihsShipBase.getOperatorCountryOfDomicileName() ==null){
                operatorCountryOfDomicileName.setValue("");
            }
            else {
                operatorCountryOfDomicileName.setValue(ihsShipBase.getOperatorCountryOfDomicileName());
            }
            if (ihsShipBase.getOperatorCountryOfRegistration() ==null){
                operatorCountryOfRegistration.setValue("");
            }
            else {
                operatorCountryOfRegistration.setValue(ihsShipBase.getOperatorCountryOfRegistration());
            }

            operator.setType("input");
            operatorCompanyCode.setType("input");
            operatorCountryOfControl.setType("input");
            operatorCountryOfDomicileName.setType("input");
            operatorCountryOfRegistration.setType("input");

            operator.setDescribe("船管经营公司");
            operatorCompanyCode.setDescribe("船管经营公司编码");
            operatorCountryOfControl.setDescribe("船管经营公司所在国");
            operatorCountryOfDomicileName.setDescribe("船管经营公司管辖国");
            operatorCountryOfRegistration.setDescribe("船管经营公司注册国");

            shipOperationData.add(operator);
            shipOperationData.add(operatorCompanyCode);
            shipOperationData.add(operatorCountryOfControl);
            shipOperationData.add(operatorCountryOfDomicileName);
            shipOperationData.add(operatorCountryOfRegistration);

            shipOperation.setData(shipOperationData);
            shipReportDetailVOS.add(shipOperation);
            //速度 油耗 speedOil
            IhsShipBaseDetailVO speedOil = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> speedOilData = new ArrayList<>();
            speedOil.setTitle("速度/油耗/燃料");
            speedOil.setId("speedOil");
            speedOil.setFormatType(1);

            ShipReportDetailDataVO speedMax  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO speedService  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO fuelType1First  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO fuelType2Second  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO consumptionSpeed1  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO consumptionSpeed2  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO fuelType1Code  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO fuelType1Capacity  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO consumptionValue1  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO consumptionValue2  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO fuelType2Code  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO fuelType2Capacity  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO bunkersDescriptiveNarrative  = new ShipReportDetailDataVO();

            speedMax.setKey("最大航速");
            speedService.setKey("服务航速");
            fuelType1First.setKey("首选燃料型号");
            fuelType2Second.setKey("次选燃料型号");
            consumptionSpeed1.setKey("油耗速度1");
            consumptionSpeed2.setKey("油耗速度2");
            fuelType1Code.setKey("燃料类型1代码");
            fuelType1Capacity.setKey("燃料类型1容量");
            consumptionValue1.setKey("油耗数值1");
            consumptionValue2.setKey("油耗数值2");
            fuelType2Code.setKey("燃料类型2代码");
            fuelType2Capacity.setKey("燃料类型2容量");
            bunkersDescriptiveNarrative.setKey("燃油加注描述");

            if (ihsShipBase.getSpeedMax() ==null){
                speedMax.setValue("");
            }
            else {
                speedMax.setValue(ihsShipBase.getSpeedMax() +" Knots");
            }
            if (ihsShipBase.getSpeedService() ==null){
                speedService.setValue("");
            }
            else {
                speedService.setValue(ihsShipBase.getSpeedService() +" Knots");
            }
            if (ihsShipBase.getFuelType1First() ==null){
                fuelType1First.setValue("");
            }
            else {
                fuelType1First.setValue(ihsShipBase.getFuelType1First());
            }
            if (ihsShipBase.getFuelType2Second() ==null){
                fuelType2Second.setValue("");
            }
            else {
                fuelType2Second.setValue(ihsShipBase.getFuelType2Second());
            }
            if (ihsShipBase.getConsumptionSpeed1() ==null){
                consumptionSpeed1.setValue("");
            }
            else {
                consumptionSpeed1.setValue(ihsShipBase.getConsumptionSpeed1() +" Knots");
            }
            if (ihsShipBase.getConsumptionSpeed2() ==null){
                consumptionSpeed2.setValue("");
            }
            else {
                consumptionSpeed2.setValue(ihsShipBase.getConsumptionSpeed2() +" Knots");
            }
            if (ihsShipBase.getFuelType1Code() ==null){
                fuelType1Code.setValue("");
            }
            else {
                fuelType1Code.setValue(ihsShipBase.getFuelType1Code());
            }
            if (ihsShipBase.getFuelType1Capacity() ==null){
                fuelType1Capacity.setValue("");
            }
            else {
                fuelType1Capacity.setValue(ihsShipBase.getFuelType1Capacity().toString());
            }
            if (ihsShipBase.getConsumptionValue1() ==null){
                consumptionValue1.setValue("");
            }
            else {
                consumptionValue1.setValue(ihsShipBase.getConsumptionValue1().toString());
            }
            if (ihsShipBase.getConsumptionValue2() ==null){
                consumptionValue2.setValue("");
            }
            else {
                consumptionValue2.setValue(ihsShipBase.getConsumptionValue2().toString());
            }
            if (ihsShipBase.getFuelType2Code() ==null){
                fuelType2Code.setValue("");
            }
            else {
                fuelType2Code.setValue(ihsShipBase.getFuelType2Code());
            }
            if (ihsShipBase.getFuelType2Capacity() ==null){
                fuelType2Capacity.setValue("");
            }
            else {
                fuelType2Capacity.setValue(ihsShipBase.getFuelType2Capacity().toString());
            }
            if (ihsShipBase.getBunkersDescriptiveNarrative() ==null){
                bunkersDescriptiveNarrative.setValue("");
            }
            else {
                bunkersDescriptiveNarrative.setValue(ihsShipBase.getBunkersDescriptiveNarrative());
            }

            speedMax.setType("input");
            speedService.setType("input");
            fuelType1First.setType("input");
            fuelType2Second.setType("input");
            consumptionSpeed1.setType("input");
            consumptionSpeed2.setType("input");
            fuelType1Code.setType("input");
            fuelType1Capacity.setType("input");
            consumptionValue1.setType("input");
            consumptionValue2.setType("input");
            fuelType2Code.setType("input");
            fuelType2Capacity.setType("input");
            bunkersDescriptiveNarrative.setType("input");

            speedMax.setDescribe("最大航速");
            speedService.setDescribe("服务航速");
            fuelType1First.setDescribe("首选燃料型号");
            fuelType2Second.setDescribe("次选燃料型号");
            consumptionSpeed1.setDescribe("油耗速度1");
            consumptionSpeed2.setDescribe("油耗速度2");
            fuelType1Code.setDescribe("燃料类型1代码");
            fuelType1Capacity.setDescribe("燃料类型1容量");
            consumptionValue1.setDescribe("油耗数值1");
            consumptionValue2.setDescribe("油耗数值2");
            fuelType2Code.setDescribe("燃料类型2代码");
            fuelType2Capacity.setDescribe("燃料类型2容量");
            bunkersDescriptiveNarrative.setDescribe("燃油加注描述");

            speedOilData.add(speedMax);
            speedOilData.add(speedService);
            speedOilData.add(fuelType1First);
            speedOilData.add(fuelType2Second);
            speedOilData.add(consumptionSpeed1);
            speedOilData.add(consumptionSpeed2);
            speedOilData.add(fuelType1Code);
            speedOilData.add(fuelType1Capacity);
            speedOilData.add(consumptionValue1);
            speedOilData.add(consumptionValue2);
            speedOilData.add(fuelType2Code);
            speedOilData.add(fuelType2Capacity);
            speedOilData.add(bunkersDescriptiveNarrative);

            speedOil.setData(speedOilData);
            shipReportDetailVOS.add(speedOil);
            //船东互保 ShipownerMutualInsurance
            IhsShipBaseDetailVO ShipownerMutualInsurance = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> ShipownerMutualInsuranceData = new ArrayList<>();
            ShipownerMutualInsurance.setTitle("船东互保");
            ShipownerMutualInsurance.setId("ShipownerMutualInsurance");
            ShipownerMutualInsurance.setFormatType(1);

            ShipReportDetailDataVO pandIClub  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO pandIClubCode  = new ShipReportDetailDataVO();

            pandIClub.setKey("船东互保协会");
            pandIClubCode.setKey("船东互保协会编号");

            if (ihsShipBase.getPandIClub() ==null){
                pandIClub.setValue("");
            }
            else {
                pandIClub.setValue(ihsShipBase.getPandIClub());
            }
            if (ihsShipBase.getPandIClubCode() ==null){
                pandIClubCode.setValue("");
            }
            else {
                pandIClubCode.setValue(ihsShipBase.getPandIClubCode());
            }

            pandIClub.setType("input");
            pandIClubCode.setType("input");

            pandIClub.setDescribe("船东互保协会");
            pandIClubCode.setDescribe("船东互保协会编号");

            ShipownerMutualInsuranceData.add(pandIClub);
            ShipownerMutualInsuranceData.add(pandIClubCode);

            ShipownerMutualInsurance.setData(ShipownerMutualInsuranceData);
            shipReportDetailVOS.add(ShipownerMutualInsurance);
            //锅炉 boiler
            IhsShipBaseDetailVO boiler = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> boilerData = new ArrayList<>();
            boiler.setTitle("锅炉");
            boiler.setId("boiler");
            boiler.setFormatType(1);

            ShipReportDetailDataVO boilerManufacturer  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO boilersDescriptiveNarrative  = new ShipReportDetailDataVO();

            boilerManufacturer.setKey("锅炉制造商");
            boilersDescriptiveNarrative.setKey("锅炉描述");

            if (ihsShipBase.getBoilerManufacturer() ==null){
                boilerManufacturer.setValue("");
            }
            else {
                boilerManufacturer.setValue(ihsShipBase.getBoilerManufacturer());
            }
            if (ihsShipBase.getBoilersDescriptiveNarrative() ==null){
                boilersDescriptiveNarrative.setValue("");
            }
            else {
                boilersDescriptiveNarrative.setValue(ihsShipBase.getBoilersDescriptiveNarrative());
            }

            boilerManufacturer.setType("input");
            boilersDescriptiveNarrative.setType("input");

            boilerManufacturer.setDescribe("锅炉制造商");
            boilersDescriptiveNarrative.setDescribe("锅炉描述");

            boilerData.add(boilerManufacturer);
            boilerData.add(boilersDescriptiveNarrative);

            boiler.setData(boilerData);
            shipReportDetailVOS.add(boiler);
            //船体信息 ShipInformation
            IhsShipBaseDetailVO ShipInformation = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> ShipInformationData = new ArrayList<>();
            ShipInformation.setTitle("船体信息");
            ShipInformation.setId("ShipInformation");
            ShipInformation.setFormatType(1);

            ShipReportDetailDataVO hullMaterial  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO hullMaterialCode  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO hullType  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO hullTypeCode  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO hullShapeCode  = new ShipReportDetailDataVO();

            hullMaterial.setKey("船体材料");
            hullMaterialCode.setKey("船体材料代码");
            hullType.setKey("船体类型");
            hullTypeCode.setKey("船体类型代码");
            hullShapeCode.setKey("船体形状代码");

            if (ihsShipBase.getHullMaterial() ==null){
                hullMaterial.setValue("");
            }
            else {
                hullMaterial.setValue(ihsShipBase.getHullMaterial());
            }
            if (ihsShipBase.getHullMaterialCode() ==null){
                hullMaterialCode.setValue("");
            }
            else {
                hullMaterialCode.setValue(ihsShipBase.getHullMaterialCode());
            }
            if (ihsShipBase.getHullType() ==null){
                hullType.setValue("");
            }
            else {
                hullType.setValue(ihsShipBase.getHullType());
            }
            if (ihsShipBase.getHullTypeCode() ==null){
                hullTypeCode.setValue("");
            }
            else {
                hullTypeCode.setValue(ihsShipBase.getHullTypeCode());
            }
            if (ihsShipBase.getHullShapeCode() ==null){
                hullShapeCode.setValue("");
            }
            else {
                hullShapeCode.setValue(ihsShipBase.getHullShapeCode());
            }

            hullMaterial.setType("input");
            hullMaterialCode.setType("input");
            hullType.setType("input");
            hullTypeCode.setType("input");
            hullShapeCode.setType("input");

            hullMaterial.setDescribe("船体材料");
            hullMaterialCode.setDescribe("船体材料代码");
            hullType.setDescribe("船体类型");
            hullTypeCode.setDescribe("船体类型代码");
            hullShapeCode.setDescribe("船体形状代码");

            ShipInformationData.add(hullMaterial);
            ShipInformationData.add(hullMaterialCode);
            ShipInformationData.add(hullType);
            ShipInformationData.add(hullTypeCode);
            ShipInformationData.add(hullShapeCode);

            ShipInformation.setData(ShipInformationData);
            shipReportDetailVOS.add(ShipInformation);
            //压载信息 ballastInformation
            IhsShipBaseDetailVO ballastInformation = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> ballastInformationData = new ArrayList<>();
            ballastInformation.setTitle("压载信息");
            ballastInformation.setId("ballastInformation");
            ballastInformation.setFormatType(1);

            ShipReportDetailDataVO parallelBodyLengthBallast  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO segregatedBallastCapacity  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO manifoldHeightAtBallastCondition  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO cleanBallastCapacity  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO midPointManifoldForwardBallast  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO permanentBallastCapacity  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO midPointManifoldAftBallast  = new ShipReportDetailDataVO();
//            ShipReportDetailDataVO segregatedBallastTankProtectedLocation  = new ShipReportDetailDataVO();

            parallelBodyLengthBallast.setKey("压载时船体平行长度");
            segregatedBallastCapacity.setKey("隔离压载舱容量");
            manifoldHeightAtBallastCondition.setKey("压载状态下货舱管道口高度");
            cleanBallastCapacity.setKey("清洁压载舱容量");
            midPointManifoldForwardBallast.setKey("前压载状态下货舱管道口中点");
            permanentBallastCapacity.setKey("永久压载舱容量");
            midPointManifoldAftBallast.setKey("压载状态下货舱管道口中点");
//            segregatedBallastTankProtectedLocation.setKey("隔离压载舱保护位置");

            if (ihsShipBase.getParallelBodyLengthBallast() ==null){
                parallelBodyLengthBallast.setValue("");
            }
            else {
                parallelBodyLengthBallast.setValue(ihsShipBase.getParallelBodyLengthBallast().toString());
            }
            if (ihsShipBase.getSegregatedBallastCapacity() ==null){
                segregatedBallastCapacity.setValue("");
            }
            else {
                segregatedBallastCapacity.setValue(ihsShipBase.getSegregatedBallastCapacity());
            }
            if (ihsShipBase.getManifoldHeightAtBallastCondition() ==null){
                manifoldHeightAtBallastCondition.setValue("");
            }
            else {
                manifoldHeightAtBallastCondition.setValue(ihsShipBase.getManifoldHeightAtBallastCondition().toString());
            }
            if (ihsShipBase.getCleanBallastCapacity() ==null){
                cleanBallastCapacity.setValue("");
            }
            else {
                cleanBallastCapacity.setValue(ihsShipBase.getCleanBallastCapacity().toString());
            }
            if (ihsShipBase.getMidPointManifoldForwardBallast() ==null){
                midPointManifoldForwardBallast.setValue("");
            }
            else {
                midPointManifoldForwardBallast.setValue(ihsShipBase.getMidPointManifoldForwardBallast().toString());
            }
            if (ihsShipBase.getPermanentBallastCapacity() ==null){
                permanentBallastCapacity.setValue("");
            }
            else {
                permanentBallastCapacity.setValue(ihsShipBase.getPermanentBallastCapacity().toString());
            }
            if (ihsShipBase.getMidPointManifoldAftBallast() ==null){
                midPointManifoldAftBallast.setValue("");
            }
            else {
                midPointManifoldAftBallast.setValue(ihsShipBase.getMidPointManifoldAftBallast().toString());
            }
//            if (ihsShipBase.getSegregatedBallastCapacity() ==null){
//                segregatedBallastTankProtectedLocation.setValue("");
//            }
//            else {
//                segregatedBallastTankProtectedLocation.setValue(ihsShipBase.getSegregatedBallastTankProtectedLocation());
//            }

            parallelBodyLengthBallast.setType("input");
            segregatedBallastCapacity.setType("input");
            manifoldHeightAtBallastCondition.setType("input");
            cleanBallastCapacity.setType("input");
            midPointManifoldForwardBallast.setType("input");
            permanentBallastCapacity.setType("input");
            midPointManifoldAftBallast.setType("input");
//            segregatedBallastTankProtectedLocation.setType("input");

            parallelBodyLengthBallast.setDescribe("压载时船体平行长度");
            segregatedBallastCapacity.setDescribe("隔离压载舱容量");
            manifoldHeightAtBallastCondition.setDescribe("压载状态下货舱管道口高度");
            cleanBallastCapacity.setDescribe("清洁压载舱容量");
            midPointManifoldForwardBallast.setDescribe("压载状态下货舱管道口中点");
            permanentBallastCapacity.setDescribe("永久压载舱容量");
            midPointManifoldAftBallast.setDescribe("前压载状态下货舱管道口中点");
//            segregatedBallastTankProtectedLocation.setDescribe("隔离压载舱保护位置");

            ballastInformationData.add(parallelBodyLengthBallast);
            ballastInformationData.add(segregatedBallastCapacity);
            ballastInformationData.add(manifoldHeightAtBallastCondition);
            ballastInformationData.add(cleanBallastCapacity);
            ballastInformationData.add(midPointManifoldForwardBallast);
            ballastInformationData.add(permanentBallastCapacity);
            ballastInformationData.add(midPointManifoldAftBallast);
//            ballastInformationData.add(segregatedBallastTankProtectedLocation);


            ballastInformation.setData(ballastInformationData);
            shipReportDetailVOS.add(ballastInformation);
            //载货信息 cargoInformation
            IhsShipBaseDetailVO cargoInformation = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> cargoInformationData = new ArrayList<>();
            cargoInformation.setTitle("载货信息");
            cargoInformation.setId("cargoInformation");
            cargoInformation.setFormatType(1);

            ShipReportDetailDataVO parallelBodyLengthLaden  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO manifoldHeightAtLadenCondition  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO midPointManifoldForwardLaden  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO midPointManifoldAftLaden  = new ShipReportDetailDataVO();

            parallelBodyLengthLaden.setKey("满载时船体平行长度");
            manifoldHeightAtLadenCondition.setKey("满载状态下货舱管道口高度");
            midPointManifoldForwardLaden.setKey("前满载状态下货舱管道口中点");
            midPointManifoldAftLaden.setKey("满载状态下货舱管道口中点");

            if (ihsShipBase.getParallelBodyLengthLaden() ==null){
                parallelBodyLengthLaden.setValue("");
            }
            else {
                parallelBodyLengthLaden.setValue(ihsShipBase.getParallelBodyLengthLaden().toString());
            }
            if (ihsShipBase.getManifoldHeightAtLadenCondition() ==null){
                manifoldHeightAtLadenCondition.setValue("");
            }
            else {
                manifoldHeightAtLadenCondition.setValue(ihsShipBase.getManifoldHeightAtLadenCondition().toString());
            }
            if (ihsShipBase.getMidPointManifoldForwardLaden() ==null){
                midPointManifoldForwardLaden.setValue("");
            }
            else {
                midPointManifoldForwardLaden.setValue(ihsShipBase.getMidPointManifoldForwardLaden().toString());
            }
            if (ihsShipBase.getMidPointManifoldAftLaden() ==null){
                midPointManifoldAftLaden.setValue("");
            }
            else {
                midPointManifoldAftLaden.setValue(ihsShipBase.getMidPointManifoldAftLaden().toString());
            }

            parallelBodyLengthLaden.setType("input");
            manifoldHeightAtLadenCondition.setType("input");
            midPointManifoldForwardLaden.setType("input");
            midPointManifoldAftLaden.setType("input");

            parallelBodyLengthLaden.setDescribe("满载时船体平行长度");
            manifoldHeightAtLadenCondition.setDescribe("满载状态下货舱管道口高度");
            midPointManifoldForwardLaden.setDescribe("满载状态下货舱管道口中点");
            midPointManifoldAftLaden.setDescribe("前满载状态下货舱管道口中点");

            cargoInformationData.add(parallelBodyLengthLaden);
            cargoInformationData.add(manifoldHeightAtLadenCondition);
            cargoInformationData.add(midPointManifoldForwardLaden);
            cargoInformationData.add(midPointManifoldAftLaden);

            cargoInformation.setData(cargoInformationData);
            shipReportDetailVOS.add(cargoInformation);
            //空载信息 emptyInformation
            IhsShipBaseDetailVO emptyInformation = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> emptyInformationData = new ArrayList<>();
            emptyInformation.setTitle("空载信息");
            emptyInformation.setId("emptyInformation");
            emptyInformation.setFormatType(1);

            ShipReportDetailDataVO parallelBodyLengthLight  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO midPointManifoldForwardLight  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO midPointManifoldAftLight  = new ShipReportDetailDataVO();

            parallelBodyLengthLight.setKey("空载时船体平行长度");
            midPointManifoldForwardLight.setKey("空载状态下货舱管道口中点");
            midPointManifoldAftLight.setKey("前空载状态下货舱管道口中点");

            if (ihsShipBase.getParallelBodyLengthLight() ==null){
                parallelBodyLengthLight.setValue("");
            }
            else {
                parallelBodyLengthLight.setValue(ihsShipBase.getParallelBodyLengthLight().toString());
            }
            if (ihsShipBase.getMidPointManifoldForwardLight() ==null){
                midPointManifoldForwardLight.setValue("");
            }
            else {
                midPointManifoldForwardLight.setValue(ihsShipBase.getMidPointManifoldForwardLight().toString());
            }
            if (ihsShipBase.getMidPointManifoldAftLight() ==null){
                midPointManifoldAftLight.setValue("");
            }
            else {
                midPointManifoldAftLight.setValue(ihsShipBase.getMidPointManifoldAftLight().toString());
            }

            parallelBodyLengthLight.setType("input");
            midPointManifoldForwardLight.setType("input");
            midPointManifoldAftLight.setType("input");

            parallelBodyLengthLight.setDescribe("空载时船体平行长度");
            midPointManifoldForwardLight.setDescribe("空载状态下货舱管道口中点");
            midPointManifoldAftLight.setDescribe("前空载状态下货舱管道口中点");

            emptyInformationData.add(parallelBodyLengthLight);
            emptyInformationData.add(midPointManifoldForwardLight);
            emptyInformationData.add(midPointManifoldAftLight);

            emptyInformation.setData(emptyInformationData);
            shipReportDetailVOS.add(emptyInformation);
            //出售 sell
            IhsShipBaseDetailVO sell = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> sellData = new ArrayList<>();
            sell.setTitle("出售");
            sell.setId("sell");
            sell.setFormatType(1);

            ShipReportDetailDataVO saleDate  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO salePriceUsd  = new ShipReportDetailDataVO();

            saleDate.setKey("出售日期");
            salePriceUsd.setKey("出售美元价格");

            if (ihsShipBase.getSaleDate() ==null){
                saleDate.setValue("");
            }
            else {
                saleDate.setValue(ihsShipBase.getSaleDate());
            }
            if (ihsShipBase.getSalePriceUsd() ==null){
                salePriceUsd.setValue("");
            }
            else {
                salePriceUsd.setValue(ihsShipBase.getSalePriceUsd().toString());
            }

            saleDate.setType("input");
            salePriceUsd.setType("input");

            saleDate.setDescribe("出售日期");
            salePriceUsd.setDescribe("出售美元价格");

            sellData.add(saleDate);
            sellData.add(salePriceUsd);

            sell.setData(sellData);
            shipReportDetailVOS.add(sell);
            //经营概况 businessOverview
            IhsShipBaseDetailVO businessOverview = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> businessOverviewData = new ArrayList<>();
            businessOverview.setTitle("经营概况");
            businessOverview.setId("businessOverview");
            businessOverview.setFormatType(1);

            ShipReportDetailDataVO bareboatCharterCompany  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO bareboatCharterCountryOfControl  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO bareboatCharterCountryOfDomicile  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO bareboatCharterCountryOfRegistration  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO bareboatCharterCompanyCode  = new ShipReportDetailDataVO();
//            ShipReportDetailDataVO bareboatCharterCountryOfControlCode  = new ShipReportDetailDataVO();
//            ShipReportDetailDataVO bareboatCharterCountryOfRegistrationCode  = new ShipReportDetailDataVO();
//            ShipReportDetailDataVO bareboatCharterCountryOfDomicileCod  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO bareboatCharterEffectiveDate  = new ShipReportDetailDataVO();

            bareboatCharterCompany.setKey("光船租赁公司");
            bareboatCharterCountryOfControl.setKey("光船租赁受管制国家");
            bareboatCharterCountryOfDomicile.setKey("光船租赁国");
            bareboatCharterCountryOfRegistration.setKey("光船租赁注册国");
            bareboatCharterCompanyCode.setKey("光船租赁公司编码");
//            bareboatCharterCountryOfControlCode.setKey("光船租赁受管制国家编码");
//            bareboatCharterCountryOfRegistrationCode.setKey("光船租赁注册国编码");
//            bareboatCharterCountryOfDomicileCod.setKey("光船租赁国编码");
            bareboatCharterEffectiveDate.setKey("光船租赁生效日期");

            if(ihsShipBase.getBareboatCharterCompany() ==null){
                bareboatCharterCompany.setValue("");
            }
            else {
                bareboatCharterCompany.setValue(ihsShipBase.getBareboatCharterCompany());
            }
            if(ihsShipBase.getBareboatCharterCountryOfControl() ==null){
                bareboatCharterCountryOfControl.setValue("");
            }
            else {
                bareboatCharterCountryOfControl.setValue(ihsShipBase.getBareboatCharterCountryOfControl());
            }
            if(ihsShipBase.getBareboatCharterCountryOfDomicile() ==null){
                bareboatCharterCountryOfDomicile.setValue("");
            }
            else {
                bareboatCharterCountryOfDomicile.setValue(ihsShipBase.getBareboatCharterCountryOfDomicile());
            }
            if(ihsShipBase.getBareboatCharterCountryOfRegistration() ==null){
                bareboatCharterCountryOfRegistration.setValue("");
            }
            else {
                bareboatCharterCountryOfRegistration.setValue(ihsShipBase.getBareboatCharterCountryOfRegistration());
            }
            if(ihsShipBase.getBareboatCharterCompanyCode() ==null){
                bareboatCharterCompanyCode.setValue("");
            }
            else {
                bareboatCharterCompanyCode.setValue(ihsShipBase.getBareboatCharterCompanyCode());
            }
//            if(ihsShipBase.getBareboatCharterCountryOfControlCode() ==null){
//                bareboatCharterCountryOfControlCode.setValue("");
//            }
//            else {
//                bareboatCharterCountryOfControlCode.setValue(ihsShipBase.getBareboatCharterCountryOfControlCode());
//            }
//            if(ihsShipBase.getBareboatCharterCountryOfRegistrationCode() ==null){
//                bareboatCharterCountryOfRegistrationCode.setValue("");
//            }
//            else {
//                bareboatCharterCountryOfRegistrationCode.setValue(ihsShipBase.getBareboatCharterCountryOfRegistrationCode());
//            }
//            if(ihsShipBase.getBareboatCharterCountryOfDomicileCod() ==null){
//                bareboatCharterCountryOfDomicileCod.setValue("");
//            }
//            else {
//                bareboatCharterCountryOfDomicileCod.setValue(ihsShipBase.getBareboatCharterCountryOfDomicileCod());
//            }
            if(ihsShipBase.getBareboatCharterEffectiveDate() ==null){
                bareboatCharterEffectiveDate.setValue("");
            }
            else {
                bareboatCharterEffectiveDate.setValue(ihsShipBase.getBareboatCharterEffectiveDate().toString());
            }

            bareboatCharterCompany.setType("input");
            bareboatCharterCountryOfControl.setType("input");
            bareboatCharterCountryOfDomicile.setType("input");
            bareboatCharterCountryOfRegistration.setType("input");
            bareboatCharterCompanyCode.setType("input");
//            bareboatCharterCountryOfControlCode.setType("input");
//            bareboatCharterCountryOfRegistrationCode.setType("input");
//            bareboatCharterCountryOfDomicileCod.setType("input");
            bareboatCharterEffectiveDate.setType("input");

            bareboatCharterCompany.setDescribe("光船租赁公司");
            bareboatCharterCountryOfControl.setDescribe("光船租赁受管制国家");
            bareboatCharterCountryOfDomicile.setDescribe("光船租赁国");
            bareboatCharterCountryOfRegistration.setDescribe("光船租赁注册国");
            bareboatCharterCompanyCode.setDescribe("光船租赁公司编码");
//            bareboatCharterCountryOfControlCode.setDescribe("光船租赁受管制国家编码");
//            bareboatCharterCountryOfRegistrationCode.setDescribe("光船租赁注册国编码");
//            bareboatCharterCountryOfDomicileCod.setDescribe("光船租赁国编码");
            bareboatCharterEffectiveDate.setDescribe("光船租赁生效日期");

            businessOverviewData.add(bareboatCharterCompany);
            businessOverviewData.add(bareboatCharterCountryOfControl);
            businessOverviewData.add(bareboatCharterCountryOfDomicile);
            businessOverviewData.add(bareboatCharterCountryOfRegistration);
            businessOverviewData.add(bareboatCharterCompanyCode);
//            businessOverviewData.add(bareboatCharterCountryOfControlCode);
//            businessOverviewData.add(bareboatCharterCountryOfRegistrationCode);
//            businessOverviewData.add(bareboatCharterCountryOfDomicileCod);
            businessOverviewData.add(bareboatCharterEffectiveDate);

            businessOverview.setData(businessOverviewData);
            shipReportDetailVOS.add(businessOverview);

            //其他 other
            IhsShipBaseDetailVO other = new IhsShipBaseDetailVO();
            List<ShipReportDetailDataVO> otherData = new ArrayList<>();
            other.setTitle("其他");
            other.setId("other");
            other.setFormatType(1);

            ShipReportDetailDataVO vapourRecoverySystem  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO closedLoadingSystem  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO bulbousBow  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO tonnesPerCentimetreImmersionTpci  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO bowToCentreManifold  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO numberOfDecks  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO inertGasSystemIgs  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO tonnageSystem69Convention  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO gearDescriptiveNarrative  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO constructionDescriptiveNarrative  = new ShipReportDetailDataVO();
            ShipReportDetailDataVO standardShipDesign  = new ShipReportDetailDataVO();

            vapourRecoverySystem.setKey("蒸汽回收系统");
            closedLoadingSystem.setKey("封闭式装货系统");
            bulbousBow.setKey("球鼻艏");
            tonnesPerCentimetreImmersionTpci.setKey("TPCI每厘米吃水装载量");
            bowToCentreManifold.setKey("艏侧推中央总管尺寸");
            numberOfDecks.setKey("甲板数量");
            inertGasSystemIgs.setKey("惰性气体系统IGS");
            tonnageSystem69Convention.setKey("吨位系统69公约");
            gearDescriptiveNarrative.setKey("船舶起重设备描述");
            constructionDescriptiveNarrative.setKey("建造细节");
            standardShipDesign.setKey("船舶设计标准");


            if (ihsShipBase.getVapourRecoverySystem() ==null){
                vapourRecoverySystem.setValue("");
            }
            else {
                vapourRecoverySystem.setValue(ihsShipBase.getVapourRecoverySystem());
            }
            if (ihsShipBase.getClosedLoadingSystem() ==null){
                closedLoadingSystem.setValue("");
            }
            else {
                closedLoadingSystem.setValue(ihsShipBase.getClosedLoadingSystem());
            }
            if (ihsShipBase.getBulbousBow() ==null){
                bulbousBow.setValue("");
            }
            else {
                bulbousBow.setValue(ihsShipBase.getBulbousBow());
            }
            if (ihsShipBase.getTonnesPerCentimetreImmersionTpci() ==null){
                tonnesPerCentimetreImmersionTpci.setValue("");
            }
            else {
                tonnesPerCentimetreImmersionTpci.setValue(ihsShipBase.getTonnesPerCentimetreImmersionTpci().toString());
            }
            if (ihsShipBase.getBowToCentreManifold() ==null){
                bowToCentreManifold.setValue("");
            }
            else {
                bowToCentreManifold.setValue(ihsShipBase.getBowToCentreManifold().toString());
            }
            if (ihsShipBase.getNumberOfDecks() ==null){
                numberOfDecks.setValue("");
            }
            else {
                numberOfDecks.setValue(ihsShipBase.getNumberOfDecks().toString());
            }
            if (ihsShipBase.getInertGasSystemIgs() ==null){
                inertGasSystemIgs.setValue("");
            }
            else {
                inertGasSystemIgs.setValue(ihsShipBase.getInertGasSystemIgs());
            }
            if (ihsShipBase.getTonnageSystem69Convention() ==null){
                tonnageSystem69Convention.setValue("");
            }
            else {
                tonnageSystem69Convention.setValue(ihsShipBase.getTonnageSystem69Convention());
            }
            if (ihsShipBase.getGearDescriptiveNarrative() ==null){
                gearDescriptiveNarrative.setValue("");
            }
            else {
                gearDescriptiveNarrative.setValue(ihsShipBase.getGearDescriptiveNarrative());
            }
            if (ihsShipBase.getConstructionDescriptiveNarrative() ==null){
                constructionDescriptiveNarrative.setValue("");
            }
            else {
                constructionDescriptiveNarrative.setValue(ihsShipBase.getConstructionDescriptiveNarrative());
            }
            if (ihsShipBase.getStandardShipDesign() ==null){
                standardShipDesign.setValue("");
            }
            else {
                standardShipDesign.setValue(ihsShipBase.getStandardShipDesign());
            }

            vapourRecoverySystem.setType("input");
            closedLoadingSystem.setType("input");
            bulbousBow.setType("input");
            tonnesPerCentimetreImmersionTpci.setType("input");
            bowToCentreManifold.setType("input");
            numberOfDecks.setType("input");
            inertGasSystemIgs.setType("input");
            tonnageSystem69Convention.setType("input");
            gearDescriptiveNarrative.setType("input");
            constructionDescriptiveNarrative.setType("input");
            standardShipDesign.setType("input");

            vapourRecoverySystem.setDescribe("蒸汽回收系统");
            closedLoadingSystem.setDescribe("封闭式装货系统");
            bulbousBow.setDescribe("球鼻艏");
            tonnesPerCentimetreImmersionTpci.setDescribe("TPCI每厘米吃水装载量");
            bowToCentreManifold.setDescribe("艏侧推中央总管尺寸");
            numberOfDecks.setDescribe("甲板数量");
            inertGasSystemIgs.setDescribe("惰性气体系统IGS");
            tonnageSystem69Convention.setDescribe("吨位系统69公约");
            gearDescriptiveNarrative.setDescribe("船舶起重设备描述");
            constructionDescriptiveNarrative.setDescribe("建造细节");
            standardShipDesign.setDescribe("船舶设计标准");



            otherData.add(vapourRecoverySystem);
            otherData.add(closedLoadingSystem);
            otherData.add(bulbousBow);
            otherData.add(tonnesPerCentimetreImmersionTpci);
            otherData.add(bowToCentreManifold);
            otherData.add(numberOfDecks);
            otherData.add(inertGasSystemIgs);
            otherData.add(tonnageSystem69Convention);
            otherData.add(gearDescriptiveNarrative);
            otherData.add(constructionDescriptiveNarrative);
            otherData.add(standardShipDesign);

            other.setData(otherData);
            shipReportDetailVOS.add(other);
        }
        return shipReportDetailVOS;

    }

    @Override
    public String export(SpOverhaulVo spOverhaulVo) throws IOException {
        List<String> ids = spOverhaulVo.getIds();
        Boolean type = spOverhaulVo.getType();
        Date currentTime = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
        String dateString = dateFormat.format(currentTime);
        String fileName = "船舶信息-"+dateString+".xlsx";

        List<String> tableInfo = spInfoDetailsMapper.getTableInfo();
        String url = null;
        if (type){
            //全导出
            List<IhsShipBaseDetails> ihsShipBaseDetails = null;
            if (ids == null || ids.isEmpty()) {
                ihsShipBaseDetails = spInfoDetailsMapper.getInfo();
                writeToExcel1(ihsShipBaseDetails, fileName, type);
            } else {
                ihsShipBaseDetails = spInfoDetailsMapper.getInFOById(ids);
                writeToExcel1(ihsShipBaseDetails, fileName, type);
            }
            File file = new File(fileName);
            FileInputStream input = new FileInputStream(file);
            MultipartFile multipartFile = new MockMultipartFile("file", file.getName(), "application/octet-stream", input);
            R<SysFile> result1 = remoteFileService.upload(multipartFile);
            if(result1.getCode() != R.SUCCESS){
                throw new BusException("文件服务器连接失败", BaseResultCode.GENERAL_ERROR);
            }
            url = result1.getData().getHttpsUrl();
            FileUtils.deleteFile(fileName);
//            Field[] fields = IhsShipBaseDetails.class.getDeclaredFields();
//            url = exportService.pageExport(ihsShipBaseDetails,fields,
//                    exportService.listStrByModuleAndUser
//                            ("ihs_ship_base_list", SecurityUtils.getUserId()),
//                    fileName);
        }else {
            List<IhsShipBaseList> ihsShipBaseDetails = null;
            //仅导出列表
            if (ids == null || ids.isEmpty()) {
                ihsShipBaseDetails = spInformationListMapper.getInfo();
//                writeToExcel2(ihsShipBaseDetails, fileName, type ,tableInfo);
            } else {
                ihsShipBaseDetails = spInformationListMapper.getInFOById(ids);
//                writeToExcel2(ihsShipBaseDetails, fileName, type ,tableInfo);
            }
            Field[] fields = IhsShipBaseList.class.getDeclaredFields();
            url = exportService.pageExport(ihsShipBaseDetails,fields,
                    exportService.listStrByModuleAndUser
                            ("ihs_ship_base_list", SecurityUtils.getUserId()),
                    fileName);
        }

        //文件地址
//        File file = new File(fileName);
//        //声明参数集合
//        HashMap<String, Object> paramMap = new HashMap<>();
//        //文件
//        paramMap.put("file", file);
//        //输出
//        paramMap.put("output","json");
//        //自定义路径
//        paramMap.put("path","image");
//        //场景
//        paramMap.put("scene","image");
//
//        paramMap.put("filename",fileName);

//        String result= HttpUtil.post(fileServerHost+"/group1/upload", paramMap);

//        Gson gson = new Gson();
//        JsonObject jsonObject = gson.fromJson(result, JsonObject.class);
////         获取"url"字段的值
//        String url = jsonObject.get("url").getAsString();

//        FileInputStream input = new FileInputStream(file);
//        MultipartFile multipartFile = new MockMultipartFile("file", file.getName(), "application/octet-stream", input);
//        R<SysFile> result1 = remoteFileService.upload(multipartFile);
//        if(result1.getCode() != R.SUCCESS){
//            throw new BusException("文件服务器连接失败", BaseResultCode.GENERAL_ERROR);
//        }
//        String url = result1.getData().getHttpsUrl();
//        FileUtils.deleteFile(fileName);
        return url;
    }

    @Override
    public Object upload(MultipartFile file,String imo) {
        R<SysFile> result1 = remoteFileService.upload(file);
        if(result1.getCode() != R.SUCCESS){
            throw new BusException("文件服务器连接失败", BaseResultCode.GENERAL_ERROR);
        }
        String result = result1.getData().getHttpsUrl();;
//        try {
//            InputStreamResource isr = new InputStreamResource(file.getInputStream(),
//                    file.getOriginalFilename());
//
//            Map<String, Object> params = new HashMap<>();
//            params.put("file", isr);
//            //params.put("path", "86501729");
//            params.put("output", "json");
//            /*params.put("auth_token", "123");*/
//            String resp = HttpRequest.post(fileServerHost + FILE_UPLOAD_PATH).form(params).timeout(-1).execute().body();
//            //String resp = HttpUtil.post(fileServerHost + FILE_UPLOAD_PATH, params);
//            JSONObject re = JSONObject.parseObject(resp);
//            if(!re.getString("retcode").equals("0")){
//                throw new BusException(re.getString("retmsg"), BaseResultCode.GENERAL_ERROR);
//            }
//            result = re.getString("domain") + re.getString("path");
//        } catch (Exception e) {
//            throw new BusException("文件服务器连接失败",BaseResultCode.GENERAL_ERROR);
//        }
        Snowflake snowflake = new Snowflake(1, 1);
        Long id1 = snowflake.nextId();
//        String info =  spInformationMapper.getByInfoID(id);
//        if (info == null){
//            spInformationMapper.deleteById(id);
//        }
//        String imo = spInformationMapper.getImoById(id);
        String info =  spInformationMapper.getFileByImo(imo);
        if (com.ship.common.core.utils.StringUtils.isNotEmpty(info)){
            spInformationMapper.deleteById(info);
        }
        spInformationMapper.upFile(String.valueOf(id1),result,imo,file.getOriginalFilename());
        return result;
    }

    @Override
    public List<Map<String,Object>> getFromB(String imo) {
//        String imo = spInformationMapper.getImoById(id);
        return spInformationMapper.getFromB(imo);
    }

    @Override
    public String getShipInfoDetailTime(String imo) {
        String time = spInformationMapper.getShipInfoDetailTime(imo);
        return time;
    }

    @Override
    public List<QueryBoatsPortSisterInfo> queryBoatsSister(QueryBoatsBaseRq queryBoatsBaseRq) {
//        PageHelper.startPage(queryBoatsBaseRq.getPageNum(),queryBoatsBaseRq.getPageSize());
        List<QueryBoatsPortSisterInfo> boatsPortSisterList = spInformationListMapper.queryBoatsSister(queryBoatsBaseRq);
//        PageInfo<QueryBoatsPortSisterInfo> pageInfo = new PageInfo<>(boatsPortSisterList);
//        List<QueryBoatsPortSisterInfo> list = spInformationListMapper.queryBoatsSisterList(queryBoatsBaseRq);
//        PageInfo<QueryBoatsPortSisterInfo> pageInfo1 = new PageInfo<>();
//        BeanUtils.copyProperties(pageInfo,pageInfo1);
//        pageInfo1.setList(list);
        return boatsPortSisterList;
    }

    @Override
    public List<QueryBoatsPortSisterInfo> exportBoatsPortSisterList(QueryBoatsBaseRq queryBoatsBaseRq){
        List<QueryBoatsPortSisterInfo> boatsPortSisterList = spInformationListMapper.queryBoatsSister(queryBoatsBaseRq);
        return boatsPortSisterList;
    }

    @Override
    public List<QueryShipMessageInfo> queryShipMessageAll() {
        List<String> imoList = new ArrayList<>();
        QueryWrapper<ConShipping> conShipWrapper = new QueryWrapper<>();
        conShipWrapper.in("status", 1, 2, 3);
        List<ConShipping> conShippings = conShippingMapper.selectList(conShipWrapper);
        if(conShippings.size() > 0){
            Map<String,List<ConShipping>> dataMap = conShippings.stream().collect(Collectors.groupingBy(ConShipping::getImo));
            for (String imo : dataMap.keySet()) {
                List<ConShipping> dataList = dataMap.get(imo);
                LambdaQueryWrapper<SpInformation> queryWrapper = new LambdaQueryWrapper<>();
                queryWrapper.eq(SpInformation::getImo, imo);
                queryWrapper.last("limit 1");
                SpInformation information = spInformationMapper.selectOne(queryWrapper);
                if (information == null) {
                    continue;
                }
                if(!imoList.contains(imo)){
                    imoList.add(imo);
                }
            }
        }
        if(imoList.size() == 0){
            return new LinkedList<>();
        }
        return spInformationListMapper.queryShipMessageAll(imoList);
    }

    private static void fillHeaderRow(Row headerRow, Class<?> clazz) {
        Field[] fields = clazz.getDeclaredFields();
        int cellNum = 0;
        for (Field field : fields) {
            ApiModelProperty apiModelProperty = field.getAnnotation(ApiModelProperty.class);
            if (apiModelProperty != null) {
                String value = apiModelProperty.value();
                headerRow.createCell(cellNum++).setCellValue(value);
            }
        }
    }

    private static void fillHeaderRow2(List<String> tableInfo, Row headerRow, Class<?> clazz) {
        Field[] fields = clazz.getDeclaredFields();
        int cellNum = 0;
        for (Field field : fields) {
            if (tableInfo.contains(field.getName())) { // 检查字段名是否在 tableInfo 中
                ApiModelProperty apiModelProperty = field.getAnnotation(ApiModelProperty.class);
                if (apiModelProperty != null) {
                    String value = apiModelProperty.value();
                    headerRow.createCell(cellNum++).setCellValue(value);
                }
            }
        }
    }

    public static void writeToExcel1(List<IhsShipBaseDetails> shipDetails, String filePath, Boolean type) {
        try (Workbook workbook = new XSSFWorkbook()) {
            Sheet sheet = workbook.createSheet("船舶详情");

            Row headerRow = sheet.createRow(0);
            if (type){
                fillHeaderRow(headerRow, IhsShipBaseDetails.class);
            }else {
                fillHeaderRow(headerRow, IhsShipBaseList.class);
            }
            int rowNum = 1;
            for (IhsShipBaseDetails details : shipDetails) {
                Row row = sheet.createRow(rowNum++);
                fillDataRow(row, details);
            }

            try (FileOutputStream fileOut = new FileOutputStream(filePath)) {
                workbook.write(fileOut);
            } catch (IOException e) {
                e.printStackTrace();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    public static void writeToExcel2(List<IhsShipBaseList> shipDetails, String filePath, Boolean type,List<String> tableInfo) {
        try (Workbook workbook = new XSSFWorkbook()) {
            Sheet sheet = workbook.createSheet("船舶详情");

            Row headerRow = sheet.createRow(0);
            if (type){
                fillHeaderRow2(tableInfo, headerRow, IhsShipBaseList.class);
            }else {
                fillHeaderRow2(tableInfo, headerRow, IhsShipBaseList.class);
            }
            int rowNum = 1;
            for (IhsShipBaseList details : shipDetails) {
                Row row = sheet.createRow(rowNum++);
                fillDataRow2(tableInfo, row, details);
            }

            try (FileOutputStream fileOut = new FileOutputStream(filePath)) {
                workbook.write(fileOut);
            } catch (IOException e) {
                e.printStackTrace();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private static void fillDataRow(Row row, IhsShipBaseDetails details) {
        Field[] fields = details.getClass().getDeclaredFields();
        int cellNum = 0;
        for (Field field : fields) {
            field.setAccessible(true);
            try {
                Object value = field.get(details);
                if (value != null) {
                    row.createCell(cellNum++).setCellValue(value.toString());
                } else {
                    row.createCell(cellNum++).setCellValue("");
                }
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }
    }

    private static void fillDataRow2(List<String> tableInfo, Row row, IhsShipBaseList details) {
        Field[] fields = details.getClass().getDeclaredFields();
        int cellNum = 0;
        for (Field field : fields) {
            // 检查字段名是否在 tableInfo 中
            if (tableInfo.contains(field.getName())) {
                field.setAccessible(true);
                try {
                    Object value = field.get(details);
                    if (value != null) {
                        row.createCell(cellNum++).setCellValue(value.toString());
                    } else {
                        row.createCell(cellNum++).setCellValue("");
                    }
                } catch (IllegalAccessException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    private boolean isEmptyList(List<?> list) {
        return list == null || list.isEmpty();
    }
}
